fs-util: when opening arbitrary inodes, better use O_NONBLOCK
In case this is a device node where opening might block.
This commit is contained in:
committed by
Yu Watanabe
parent
22a0a36efa
commit
1071c195f7
+1
-2
@@ -1472,8 +1472,7 @@ int fsync_path_at(int at_fd, const char *path) {
|
||||
} else
|
||||
fd = at_fd;
|
||||
} else {
|
||||
|
||||
opened_fd = openat(at_fd, path, O_RDONLY|O_CLOEXEC);
|
||||
opened_fd = openat(at_fd, path, O_RDONLY|O_CLOEXEC|O_NONBLOCK);
|
||||
if (opened_fd < 0)
|
||||
return -errno;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user