]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
Check return value reading from signal pipe
authorRobert Ancell <robert.ancell@canonical.com>
Thu, 5 Sep 2013 08:11:23 +0000 (20:11 +1200)
committerRobert Ancell <robert.ancell@canonical.com>
Thu, 5 Sep 2013 08:11:23 +0000 (20:11 +1200)
src/process.c

index 819d879ae727aa09e097268d47ae7e3d157e7b21..073cf866111fb2425aab46b5ca3da7a6a8b38f26 100644 (file)
@@ -322,8 +322,9 @@ handle_signal (GIOChannel *source, GIOCondition condition, gpointer data)
     pid_t pid;
     Process *process;
 
-    if (read (signal_pipe[0], &signo, sizeof (int)) < 0 || 
-        read (signal_pipe[0], &pid, sizeof (pid_t)) < 0)
+    errno = 0;
+    if (read (signal_pipe[0], &signo, sizeof (int)) != sizeof (int) || 
+        read (signal_pipe[0], &pid, sizeof (pid_t)) != sizeof (pid_t))
     {
         g_warning ("Error reading from signal pipe: %s", strerror (errno));
         return TRUE;