libarchive/libarchive-ignore-sigpipe-in-test-suite.patch

35 lines
963 B
Diff

diff -ur libarchive-2.8.5-orig/libarchive/test/main.c libarchive-2.8.5/libarchive/test/main.c
--- libarchive-2.8.5-orig/libarchive/test/main.c 2010-06-29 12:06:59.000000000 +1200
+++ libarchive-2.8.5/libarchive/test/main.c 2011-11-04 20:36:13.000000000 +1300
@@ -28,6 +28,7 @@
#include <locale.h>
#include <stdarg.h>
#include <time.h>
+#include <signal.h>
/*
* This same file is used pretty much verbatim for all test harnesses.
@@ -1873,6 +1874,7 @@
const char *tmp, *option_arg, *p;
char tmpdir[256];
char tmpdir_timestamp[256];
+ struct sigaction sa;
(void)argc; /* UNUSED */
@@ -2002,6 +2004,14 @@
#endif
/*
+ * Ignore SIGPIPE signals
+ */
+ sa.sa_handler = SIG_IGN;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ sigaction(SIGPIPE, &sa, NULL);
+
+ /*
* Create a temp directory for the following tests.
* Include the time the tests started as part of the name,
* to make it easier to track the results of multiple tests.