From: Ben Pfaff Date: Fri, 9 Jan 2009 01:00:06 +0000 (-0800) Subject: daemon: report error if daemon child process fails to start properly X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f813cab633075834a7cc37b1a73fb3709c432339;p=openvswitch daemon: report error if daemon child process fails to start properly Found by Chris Eagle via Fortify. --- diff --git a/lib/daemon.c b/lib/daemon.c index 3f417d42..4d7b044b 100644 --- a/lib/daemon.c +++ b/lib/daemon.c @@ -214,7 +214,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: