]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homed: handle EINTR gracefully when waiting for device node
authorLennart Poettering <lennart@poettering.net>
Tue, 22 Nov 2022 11:55:10 +0000 (12:55 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 22 Nov 2022 12:09:53 +0000 (13:09 +0100)
src/home/homework-luks.c

index 97fb5a10510192cfce385da130f379b4501b3d08..5e1d5bbd6591cb35a10de3257161192952935cc8 100644 (file)
@@ -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);
         }