mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-28 01:52:06 +08:00
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:
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user