diff options
author | Lee Duncan <leeman.duncan@gmail.com> | 2020-04-27 09:38:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-27 09:38:11 -0700 |
commit | 433288fd876a31a83d77cad07419f8da793091ea (patch) | |
tree | 2f4f0e8bd940342b09f7e8c8cf464fa03fda0f97 | |
parent | f6a8d1abaf22c7ee8d23c92e95b73d6f3d143bd6 (diff) | |
parent | 71e4ce5e7722dde25751025cac0e8b29d8d540df (diff) | |
download | open-iscsi-433288fd876a31a83d77cad07419f8da793091ea.tar.gz |
Merge pull request #205 from fredvx/patch-2
Fix SIGPIPE loop in signal handler
-rw-r--r-- | usr/iscsid.c | 7 |
1 files changed, 6 insertions, 1 deletions
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) |