summaryrefslogtreecommitdiff
path: root/src/home
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-11-22 12:55:10 +0100
committerLennart Poettering <lennart@poettering.net>2022-11-22 13:09:53 +0100
commitf3d9278f38f0a9e03ed29215f27d8ca21c1fa6a1 (patch)
tree8ffb88d1a810b8e4ff2e31af929d78e35c4a45ff /src/home
parent6d66a221685c15798e796d9738f73fdb1fdccdb2 (diff)
downloadsystemd-f3d9278f38f0a9e03ed29215f27d8ca21c1fa6a1.tar.gz
homed: handle EINTR gracefully when waiting for device node
Diffstat (limited to 'src/home')
-rw-r--r--src/home/homework-luks.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/home/homework-luks.c b/src/home/homework-luks.c
index 97fb5a1051..5e1d5bbd65 100644
--- a/src/home/homework-luks.c
+++ b/src/home/homework-luks.c
@@ -2017,9 +2017,12 @@ static int wait_for_devlink(const char *path) {
if (w >= until)
return log_error_errno(SYNTHETIC_ERRNO(ETIMEDOUT), "Device link %s still hasn't shown up, giving up.", path);
- r = fd_wait_for_event(inotify_fd, POLLIN, usec_sub_unsigned(until, w));
- if (r < 0)
+ r = fd_wait_for_event(inotify_fd, POLLIN, until - w);
+ if (r < 0) {
+ if (ERRNO_IS_TRANSIENT(r))
+ continue;
return log_error_errno(r, "Failed to watch inotify: %m");
+ }
(void) flush_fd(inotify_fd);
}