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:
Lennart Poettering
2021-03-04 14:50:38 +09:00
committed by Yu Watanabe
parent 22a0a36efa
commit 1071c195f7
+1 -2
View File
@@ -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;