We can ignore the signal, as the affected libuv calls report error
by returning EPIPE anyway.
Fixes https://gitlab.labs.nic.cz/knot/knot-resolver/issues/271
+Knot Resolver 1.5.1 (2017-1x-yy)
+================================
+
+Bugfixes
+--------
+- fix SIGPIPE crashes
+
+
Knot Resolver 1.5.0 (2017-11-02)
================================
*/
#include <arpa/inet.h>
+#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
}
}
+ /* Workaround for https://github.com/libuv/libuv/issues/45
+ * (Write after ECONNRESET crash.) */
+ if (ret && signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
+ kr_log_error("[system] can't block SIGPIPE signal: %s\n",
+ strerror(errno));
+ ret = EXIT_FAILURE;
+ }
+
if (ret != 0) {
goto cleanup;
}