aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/main.c b/main.c
index 891e19f..6388fe2 100644
--- a/main.c
+++ b/main.c
@@ -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]);