stream: Add stream_run(), stream_run_wait() functions.
[openvswitch] / lib / daemon.c
index c4effa9b0b91c425326b29e365a94febe0631da7..9a1be55dbfc868d14274a138e9bd28c1491dc521 100644 (file)
@@ -25,6 +25,7 @@
 #include "fatal-signal.h"
 #include "dirs.h"
 #include "lockfile.h"
+#include "socket-util.h"
 #include "timeval.h"
 #include "util.h"
 
@@ -280,9 +281,14 @@ void
 daemonize_complete(void)
 {
     if (detach) {
-        char c = 0;
+        size_t bytes_written;
+        int error;
+
+        error = write_fully(daemonize_fds[1], "", 1, &bytes_written);
+        if (error) {
+            ovs_fatal(error, "could not write to pipe");
+        }
 
-        ignore(write(daemonize_fds[1], &c, 1));
         close(daemonize_fds[1]);
         setsid();
         if (chdir_) {