X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fdaemon.c;h=672568342a76c4bf3d3c8f0d22368c8a4eb352fb;hb=6c4ea27c48b30eaec8e37e642d5072f53c5b2670;hp=c4a82647f8ace909101e36d89409a024cce9b70d;hpb=e0edde6fee279cdbbf3c179f5f50adaf0c7c7f1e;p=openvswitch diff --git a/lib/daemon.c b/lib/daemon.c index c4a82647..67256834 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) {