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

Wrap fsync and close in HANDLE_EINTR for Robustness
old-commit-hash: ea5ee29ebd
pull/33302/head
Dean Lee 9 months ago committed by GitHub
parent b12b30c328
commit c92010d0ac
  1. 4
      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;
}

Loading…
Cancel
Save