daemon: report error if daemon child process fails to start properly
[sliver-openvswitch.git] / lib / daemon.c
index b8fc5af..3163657 100644 (file)
@@ -213,7 +213,9 @@ daemonize(void)
             /* Parent process: wait for child to create pidfile, then exit. */
             close(fds[1]);
             fatal_signal_fork();
-            read(fds[0], &c, 1);
+            if (read(fds[0], &c, 1) != 1) {
+                ofp_fatal(errno, "daemon child failed to signal startup");
+            }
             exit(0);
 
         case 0: