X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fdaemon.c;h=5ed2895170481dbc1a7d2108a0672e4e9257dd0b;hb=4b0424809b823101c969a0691fc1db0c880ae64a;hp=3c1e5c3b7817a63dfa6e0dffd8a290960868f999;hpb=85606e05b691be7c2f2d4bcf0e91170b71ec8fbb;p=sliver-openvswitch.git diff --git a/lib/daemon.c b/lib/daemon.c index 3c1e5c3b7..5ed289517 100644 --- a/lib/daemon.c +++ b/lib/daemon.c @@ -289,7 +289,6 @@ fork_and_clean_up(void) fatal_signal_fork(); } else if (!pid) { /* Running in child process. */ - time_postfork(); lockfile_postfork(); } return pid; @@ -342,7 +341,7 @@ fork_and_wait_for_startup(int *fdp) } else if (retval < 0) { VLOG_FATAL("waitpid failed (%s)", ovs_strerror(errno)); } else { - NOT_REACHED(); + OVS_NOT_REACHED(); } } close(fds[0]); @@ -377,6 +376,8 @@ should_restart(int status) { if (WIFSIGNALED(status)) { static const int error_signals[] = { + /* This list of signals is documented in daemon.man. If you + * change the list, update the documentation too. */ SIGABRT, SIGALRM, SIGBUS, SIGFPE, SIGILL, SIGPIPE, SIGSEGV, SIGXCPU, SIGXFSZ }; @@ -400,7 +401,7 @@ monitor_daemon(pid_t daemon_pid) char *status_msg; int crashes; - subprogram_name = "monitor"; + set_subprogram_name("monitor"); status_msg = xstrdup("healthy"); last_restart = TIME_MIN; crashes = 0; @@ -470,7 +471,7 @@ monitor_daemon(pid_t daemon_pid) /* Running in new daemon process. */ proctitle_restore(); - subprogram_name = ""; + set_subprogram_name(""); } /* Close standard file descriptors (except any that the client has requested we @@ -529,6 +530,8 @@ daemonize_start(void) /* Running in daemon process. */ } + forbid_forking("running in daemon process"); + if (pidfile) { make_pidfile(); }