projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
22a0a36
)
fs-util: when opening arbitrary inodes, better use O_NONBLOCK
author
Lennart Poettering
<lennart@poettering.net>
Mon, 1 Feb 2021 16:11:26 +0000
(17:11 +0100)
committer
Yu Watanabe
<watanabe.yu+github@gmail.com>
Thu, 4 Mar 2021 05:50:38 +0000
(14:50 +0900)
In case this is a device node where opening might block.
src/basic/fs-util.c
patch
|
blob
|
history
diff --git
a/src/basic/fs-util.c
b/src/basic/fs-util.c
index c8885e5aa1a19edabbfef08569e1adb44461bee7..8a726e72de0cd7473ee4f38644a8c93d1b9a1110 100644
(file)
--- a/
src/basic/fs-util.c
+++ b/
src/basic/fs-util.c
@@
-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;