Commit 2ba2a5e8 authored by Vladimír Čunát's avatar Vladimír Čunát

daemon: block SIGPIPE

We can ignore the signal, as the affected libuv calls report error
by returning EPIPE anyway.
Fixes knot/knot-resolver#271
parent 7ae0cd04
Knot Resolver 1.5.1 (2017-1x-yy)
================================
Bugfixes
--------
- fix SIGPIPE crashes
Knot Resolver 1.5.0 (2017-11-02)
================================
......
......@@ -15,6 +15,7 @@
*/
#include <arpa/inet.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
......@@ -640,6 +641,14 @@ int main(int argc, char **argv)
}
}
/* 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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment