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) {
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;
}
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);