chiark / gitweb /
shutdown: properly handle sigtimedwait() timing out
authorLennart Poettering <lennart@poettering.net>
Tue, 26 Oct 2010 18:51:15 +0000 (20:51 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 26 Oct 2010 18:51:15 +0000 (20:51 +0200)
src/shutdown.c

index bd4b69b..e8d2501 100644 (file)
@@ -140,7 +140,8 @@ static int send_signal(int sign) {
 
                 timespec_store(&ts, until - n);
                 if (sigtimedwait(&mask, NULL, &ts) != SIGCHLD)
-                        log_warning("Failed: sigtimedwait did not return SIGCHLD: %m");
+                        if (errno != EAGAIN)
+                                log_warning("Failed: sigtimedwait did not return SIGCHLD: %m");
         }
 
 finish:
@@ -189,7 +190,8 @@ static int rescue_send_signal(int sign) {
 
                 timespec_store(&ts, until - n);
                 if (sigtimedwait(&mask, NULL, &ts) != SIGCHLD)
-                        log_warning("Failed: sigtimedwait did not return SIGCHLD: %m");
+                        if (errno != EAGAIN)
+                                log_warning("Failed: sigtimedwait did not return SIGCHLD: %m");
         }
 
 finish: