From: Steinar H. Gunderson Date: Sun, 14 Apr 2013 16:48:02 +0000 (+0200) Subject: Move SIGHUP handling as soon as possible, so that repeated SIGHUPing is less likely... X-Git-Tag: 1.0.0~113 X-Git-Url: https://git.sesse.net/?p=cubemap;a=commitdiff_plain;h=12d67c6bacb4726ad99040590aa64fd765c74167 Move SIGHUP handling as soon as possible, so that repeated SIGHUPing is less likely to kill us. --- diff --git a/main.cpp b/main.cpp index 0727314..39d5e1e 100644 --- a/main.cpp +++ b/main.cpp @@ -214,6 +214,8 @@ bool dry_run_config(const std::string &argv0, const std::string &config_filename int main(int argc, char **argv) { + signal(SIGHUP, hup); + // Parse options. int state_fd = -1; bool test_config = false; @@ -324,8 +326,6 @@ start: stats_thread->run(); } - signal(SIGHUP, hup); - struct timeval server_start; gettimeofday(&server_start, NULL); if (state_fd != -1) {