#include <time.h>
#include <getopt.h>
-#include "postlicyd.h"
+#include "common.h"
static sig_atomic_t cleanexit = false;
static sig_atomic_t sigint = false;
static void main_loop(void)
{
+ int sock = -1;
+
while (!sigint) {
- int fd = accept(-1, NULL, 0);
+ int fd = accept(sock, NULL, 0);
pthread_attr_t attr;
pthread_t dummy;
pthread_create(&dummy, &attr, job_run, (void *)(intptr_t)fd);
pthread_attr_destroy(&attr);
}
+
+ cleanexit = true;
+ close(sock);
}
static void main_shutdown(void)
main_initialize();
main_loop();
- cleanexit = true;
main_shutdown();
return EXIT_SUCCESS;
}