]> git.sesse.net Git - cubemap/commitdiff
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 07273141fe04b5ec17bf0e3de7394deb414b501a..39d5e1ed321851d27c94b03b822f2b517640a21e 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) {