daemon: Add comment.
authorBen Pfaff <blp@nicira.com>
Mon, 14 May 2012 21:21:18 +0000 (14:21 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 14 May 2012 21:21:18 +0000 (14:21 -0700)
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/daemon.c

index c4a8264..6725683 100644 (file)
@@ -245,6 +245,17 @@ daemonize(void)
     daemonize_complete();
 }
 
+/* Forks, then:
+ *
+ *   - In the parent, waits for the child to signal that it has completed its
+ *     startup sequence.  Then stores -1 in '*fdp' and returns the child's pid.
+ *
+ *   - In the child, stores a fd in '*fdp' and returns 0.  The caller should
+ *     pass the fd to fork_notify_startup() after it finishes its startup
+ *     sequence.
+ *
+ * If something goes wrong with the fork, logs a critical error and aborts the
+ * process. */
 static pid_t
 fork_and_wait_for_startup(int *fdp)
 {