]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix(redis-storage): Ignore SIGPIPE
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 9 Sep 2021 18:55:53 +0000 (20:55 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 9 Sep 2021 19:34:53 +0000 (21:34 +0200)
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.

src/SignalHandler.cpp

index 9051eeb0dffb432beb48ab98d7efe00b19b9c274..2d32ac6d038a929226d0a157179191e1c39fcd84 100644 (file)
@@ -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()