Warn about broken pipes in filters instead of exiting abruptly

This commit is contained in:
Eric Fischer
2016-12-21 10:10:22 -08:00
parent 6a5461763c
commit 71ac6596af
3 changed files with 24 additions and 7 deletions
+3
View File
@@ -24,6 +24,7 @@
#include <sys/resource.h>
#include <pthread.h>
#include <getopt.h>
#include <signal.h>
#include <vector>
#include <string>
#include <set>
@@ -2207,6 +2208,8 @@ int main(int argc, char **argv) {
}
}
signal(SIGPIPE, SIG_IGN);
files_open_at_start = open("/dev/null", O_RDONLY | O_CLOEXEC);
if (files_open_at_start < 0) {
perror("open /dev/null");