diff options
author | Omar Polo <op@omarpolo.com> | 2020-11-03 15:48:26 +0100 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2020-11-03 15:48:26 +0100 |
commit | 0cf902af628108c5038cd20f5958d524a812e232 (patch) | |
tree | d0e255b1a353564bdba7a03c1c9418d256dab03b | |
parent | 9468027ba731a6ca955df8f49edd51cb4b46390a (diff) |
ignore SIGPIPE
bad clients can shutdown the socket and we will exit due to a SIGPIPE.
it ain’t fun.
-rw-r--r-- | gmid.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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': |