ignore SIGPIPE

bad clients can shutdown the socket and we will exit due to a SIGPIPE.
it ain’t fun.
This commit is contained in:
Omar Polo 2020-11-03 15:48:26 +01:00
parent 9468027ba7
commit 0cf902af62
No known key found for this signature in database
GPG Key ID: 35F98C96A1786F0D
1 changed files with 3 additions and 0 deletions

3
gmid.c
View File

@ -25,6 +25,7 @@
#include <errno.h>
#include <fcntl.h>
#include <poll.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -668,6 +669,8 @@ main(int argc, char **argv)
struct tls_config *conf;
int sock, ch;
signal(SIGPIPE, SIG_IGN);
while ((ch = getopt(argc, argv, "c:d:hk:")) != -1) {
switch (ch) {
case 'c':