summaryrefslogtreecommitdiff
path: root/lib/daemon.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-05-14 14:21:18 -0700
committerBen Pfaff <blp@nicira.com>2012-05-14 14:21:18 -0700
commite6c5e5390395a2ef19676319caa97b4e5a6942e2 (patch)
treec7d437bb0a52c0a37abf755648419c59b93e77b0 /lib/daemon.c
parent7dea6ace339f1a7433040f590feb3b2d19089af5 (diff)
downloadopenvswitch-e6c5e5390395a2ef19676319caa97b4e5a6942e2.tar.gz
daemon: Add comment.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/daemon.c')
-rw-r--r--lib/daemon.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/daemon.c b/lib/daemon.c
index c4a82647f..672568342 100644
--- a/lib/daemon.c
+++ b/lib/daemon.c
@@ -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)
{