]> git.sesse.net Git - cubemap/blobdiff - main.cpp
Remove some obsolete #defines.
[cubemap] / main.cpp
index 2af1996fe670d7152c81552e00018f17052f3aac..1773af3bff7e9341ef89e7ae39dd9e41813f1f88 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -25,9 +25,6 @@
 #include "input.h"
 #include "state.pb.h"
 
-#define STREAM_ID "stream"
-#define STREAM_URL "http://gruessi.zrh.sesse.net:4013/"
-
 using namespace std;
 
 ServerPool *servers = NULL;
@@ -94,7 +91,7 @@ void *acceptor_thread_run(void *arg)
                pfd.events = POLLIN;
 
                int nfds = poll(&pfd, 1, 50);
-               if (nfds == 0 || (nfds == -1 && errno == EAGAIN)) {
+               if (nfds == 0 || (nfds == -1 && errno == EINTR)) {
                        continue;
                }
                if (nfds == -1) {
@@ -187,7 +184,7 @@ sleep:
                int left_to_sleep = parms->stats_interval;
                do {
                        left_to_sleep = sleep(left_to_sleep);
-               } while (left_to_sleep > 0);
+               } while (left_to_sleep > 0 && !hupped);
        }
        return NULL;
 }
@@ -433,11 +430,13 @@ int main(int argc, char **argv)
        gettimeofday(&serialize_start, NULL);
 
        if (!stats_file.empty()) {
+               pthread_kill(stats_thread, SIGHUP);
                if (pthread_join(stats_thread, NULL) == -1) {
                        perror("pthread_join");
                        exit(1);
                }
        }
+       pthread_kill(acceptor_thread, SIGHUP);
        if (pthread_join(acceptor_thread, NULL) == -1) {
                perror("pthread_join");
                exit(1);