diff options
-rw-r--r-- | main.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,4 @@ +#define _GNU_SOURCE // sigaction #include <stdio.h> #include <stdbool.h> #include <string.h> @@ -142,7 +143,14 @@ int main(int argc,char **argv){ return 1; } - signal(SIGCHLD,signal_handler); + struct sigaction sa; + sa.sa_handler=signal_handler; + sigemptyset(&sa.sa_mask); + sa.sa_flags=SA_RESTART; + if(sigaction(SIGCHLD,&sa,NULL)<0){ + perror("sigaction"); + return 1; + } printf("Listening on port %d\n",PORT); |