From 71e4ce5e7722dde25751025cac0e8b29d8d540df Mon Sep 17 00:00:00 2001 From: fredvx <48496214+fredvx@users.noreply.github.com> Date: Wed, 22 Apr 2020 14:24:50 -0400 Subject: Fix SIGPIPE loop in signal handler --- usr/iscsid.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'usr') diff --git a/usr/iscsid.c b/usr/iscsid.c index 99d27ab..e501498 100644 --- a/usr/iscsid.c +++ b/usr/iscsid.c @@ -310,7 +310,12 @@ static void iscsid_shutdown(void) static void catch_signal(int signo) { - log_debug(1, "pid %d caught signal %d", getpid(), signo); + /* + * Do not try to call log_debug() if there is a PIPE error + * because we can get caught in a PIPE error loop. + */ + if (signo != SIGPIPE) + log_debug(1, "pid %d caught signal %d", getpid(), signo); /* In foreground mode, treat SIGINT like SIGTERM */ if (!daemonize && signo == SIGINT) -- cgit v1.2.1