Move SIGHUP handling as soon as possible, so that repeated SIGHUPing is less likely...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 14 Apr 2013 16:48:02 +0000 (18:48 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 14 Apr 2013 16:48:02 +0000 (18:48 +0200)
main.cpp

index 0727314..39d5e1e 100644 (file)
--- 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) {