1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-10 00:58:20 +03:00

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-02-01 17:11:26 +01:00 committed by Yu Watanabe
parent 22a0a36efa
commit 1071c195f7

View File

@ -1472,8 +1472,7 @@ int fsync_path_at(int at_fd, const char *path) {
} else } else
fd = at_fd; fd = at_fd;
} else { } else {
opened_fd = openat(at_fd, path, O_RDONLY|O_CLOEXEC|O_NONBLOCK);
opened_fd = openat(at_fd, path, O_RDONLY|O_CLOEXEC);
if (opened_fd < 0) if (opened_fd < 0)
return -errno; return -errno;