chiark / gitweb /
Rename more things to elogind
[elogind.git] / src / core / execute.c
index 39ec5adbbe44f2783691945a7816c0dd0f393424..027e3319ed1421244f5cd79e14fa3badd2657857 100644 (file)
@@ -61,7 +61,6 @@
 #include "namespace.h"
 #include "exit-status.h"
 #include "missing.h"
-#include "utmp-wtmp.h"
 #include "def.h"
 #include "path-util.h"
 #include "env-util.h"
@@ -1159,10 +1158,10 @@ static void do_idle_pipe_dance(int idle_pipe[4]) {
 
                 if (idle_pipe[3] >= 0 && r == 0 /* timeout */) {
                         /* Signal systemd that we are bored and want to continue. */
-                        write(idle_pipe[3], "x", 1);
-
-                        /* Wait for systemd to react to the signal above. */
-                        fd_wait_for_event(idle_pipe[0], POLLHUP, IDLE_TIMEOUT2_USEC);
+                        r = write(idle_pipe[3], "x", 1);
+                        if (r > 0)
+                                /* Wait for systemd to react to the signal above. */
+                                fd_wait_for_event(idle_pipe[0], POLLHUP, IDLE_TIMEOUT2_USEC);
                 }
 
                 safe_close(idle_pipe[0]);