From c92010d0ac4e5ec0cbc32f081008e0e2f90919da Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Sat, 3 Aug 2024 03:16:24 +0800 Subject: [PATCH] params: wrap fsync and close in HANDLE_EINTR for robustness (#33154) Wrap fsync and close in HANDLE_EINTR for Robustness old-commit-hash: ea5ee29ebddf0a17bd884f23de6b6a5a288ebd10 --- common/params.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/params.cc b/common/params.cc index 03a3cc31f1..615dd55abd 100644 --- a/common/params.cc +++ b/common/params.cc @@ -24,8 +24,8 @@ int fsync_dir(const std::string &path) { int result = -1; int fd = HANDLE_EINTR(open(path.c_str(), O_RDONLY, 0755)); if (fd >= 0) { - result = fsync(fd); - close(fd); + result = HANDLE_EINTR(fsync(fd)); + HANDLE_EINTR(close(fd)); } return result; }