params: wrap fsync and close in HANDLE_EINTR for robustness (#33154)

Wrap fsync and close in HANDLE_EINTR for Robustness
old-commit-hash: ea5ee29ebddf0a17bd884f23de6b6a5a288ebd10
This commit is contained in:
Dean Lee
2024-08-03 03:16:24 +08:00
committed by GitHub
parent b12b30c328
commit c92010d0ac
+2 -2
View File
@@ -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;
}