summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2021-09-09 20:55:53 +0200
committerJoel Rosdahl <joel@rosdahl.net>2021-09-09 21:34:53 +0200
commitb2a88e7b885cd43882b525fdaf2b57dd931a0427 (patch)
tree0fae90d7d05648883df096986a05037f263144b8
parentafc89032c0805daf0236df95e0a18177fd46dc75 (diff)
downloadccache-b2a88e7b885cd43882b525fdaf2b57dd931a0427.tar.gz
fix(redis-storage): Ignore SIGPIPE
libhiredis doesn’t pass MSG_NOSIGNAL to send to ccache can die from SIGPIPE. Disable SIGPIPE so that the socket code receives EPIPE correctly. This should also fix a similar problem with the HTTP storage backend. Fixes #931.
-rw-r--r--src/SignalHandler.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/SignalHandler.cpp b/src/SignalHandler.cpp
index 9051eeb0..2d32ac6d 100644
--- a/src/SignalHandler.cpp
+++ b/src/SignalHandler.cpp
@@ -71,6 +71,8 @@ SignalHandler::SignalHandler(Context& ctx) : m_ctx(ctx)
# ifdef SIGQUIT
register_signal_handler(SIGQUIT);
# endif
+
+ signal(SIGPIPE, SIG_IGN); // NOLINT: This is no error, clang-tidy
}
SignalHandler::~SignalHandler()