From 0cf902af628108c5038cd20f5958d524a812e232 Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Tue, 3 Nov 2020 15:48:26 +0100 Subject: [PATCH] ignore SIGPIPE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bad clients can shutdown the socket and we will exit due to a SIGPIPE. it ain’t fun. --- gmid.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gmid.c b/gmid.c index 1a5de19..171b6d2 100644 --- a/gmid.c +++ b/gmid.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -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':