diff options
| author | tomsmeding <tom.smeding@gmail.com> | 2017-05-24 09:43:55 +0200 | 
|---|---|---|
| committer | tomsmeding <tom.smeding@gmail.com> | 2017-05-24 09:43:55 +0200 | 
| commit | e4914ccdfa4d9eb6f71f7b5cc5b4881c4e911778 (patch) | |
| tree | d4e9996e9e18e1f90a1e1d0b36a6297e78ed0894 | |
| parent | 0cfd3e87bba5faee5994dc915ab6485f0cf6832c (diff) | |
server: Ignore SIGPIPE
| -rw-r--r-- | main.c | 9 | 
1 files changed, 9 insertions, 0 deletions
| @@ -3,6 +3,7 @@  #include <stdlib.h>  #include <string.h>  #include <unistd.h> +#include <signal.h>  #include <sys/socket.h>  #include <netinet/in.h>  #include <errno.h> @@ -148,9 +149,17 @@ void srandomdev(void){  }  #endif +void signal_handler(int sig){ +	if(sig==SIGPIPE){ +		// ignore +	} +} +  int main(int argc,char **argv){  	srandomdev(); +	signal(SIGPIPE,signal_handler); +  	plugin_init();  	for(int i=1;i<argc;i++){  		plugin_register(argv[i]); | 
