From 21fa70e2f6da6a9edaaeb00152e46bcb0d1aabf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Wed, 22 Jan 2020 17:59:39 +0000 Subject: [PATCH] tests: conditionalize use of SIGPIPE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SIGPIPE is not available on the Windows platform. Reviewed-by: Pavel Hrdina Signed-off-by: Daniel P. Berrangé --- tests/virauthconfigtest.c | 2 ++ tests/virkeyfiletest.c | 2 ++ tests/virlockspacetest.c | 2 ++ tests/virnetmessagetest.c | 2 ++ tests/virnetsockettest.c | 2 ++ tests/virtimetest.c | 2 ++ tests/viruritest.c | 2 ++ 7 files changed, 14 insertions(+) diff --git a/tests/virauthconfigtest.c b/tests/virauthconfigtest.c index e3bd927dcb..20855f004e 100644 --- a/tests/virauthconfigtest.c +++ b/tests/virauthconfigtest.c @@ -84,7 +84,9 @@ mymain(void) virAuthConfigPtr config; +#ifndef WIN32 signal(SIGPIPE, SIG_IGN); +#endif /* WIN32 */ #define TEST_LOOKUP(config, hostname, service, credname, expect) \ do { \ diff --git a/tests/virkeyfiletest.c b/tests/virkeyfiletest.c index b1236a47e1..abdf06c4a7 100644 --- a/tests/virkeyfiletest.c +++ b/tests/virkeyfiletest.c @@ -109,7 +109,9 @@ mymain(void) { int ret = 0; +#ifndef WIN32 signal(SIGPIPE, SIG_IGN); +#endif /* WIN32 */ if (virTestRun("Test parse", testParse, NULL) < 0) ret = -1; diff --git a/tests/virlockspacetest.c b/tests/virlockspacetest.c index 40395e8c72..3afedb4c46 100644 --- a/tests/virlockspacetest.c +++ b/tests/virlockspacetest.c @@ -342,7 +342,9 @@ mymain(void) { int ret = 0; +#ifndef WIN32 signal(SIGPIPE, SIG_IGN); +#endif /* WIN32 */ if (virTestRun("Lockspace creation", testLockSpaceCreate, NULL) < 0) ret = -1; diff --git a/tests/virnetmessagetest.c b/tests/virnetmessagetest.c index b0a01e8b9d..a207f2d85f 100644 --- a/tests/virnetmessagetest.c +++ b/tests/virnetmessagetest.c @@ -525,7 +525,9 @@ mymain(void) { int ret = 0; +#ifndef WIN32 signal(SIGPIPE, SIG_IGN); +#endif /* WIN32 */ if (virTestRun("Message Header Encode", testMessageHeaderEncode, NULL) < 0) ret = -1; diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index af11a0f6e8..9dfc707c90 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -522,7 +522,9 @@ mymain(void) int freePort; #endif +#ifndef WIN32 signal(SIGPIPE, SIG_IGN); +#endif /* WIN32 */ virEventRegisterDefaultImpl(); diff --git a/tests/virtimetest.c b/tests/virtimetest.c index f9ac55192d..5736245722 100644 --- a/tests/virtimetest.c +++ b/tests/virtimetest.c @@ -115,7 +115,9 @@ mymain(void) { int ret = 0; +#ifndef WIN32 signal(SIGPIPE, SIG_IGN); +#endif /* WIN32 */ #define TEST_FIELDS(ts, year, mon, day, hour, min, sec) \ do { \ diff --git a/tests/viruritest.c b/tests/viruritest.c index 07cf7261d1..0edf3e5522 100644 --- a/tests/viruritest.c +++ b/tests/viruritest.c @@ -145,7 +145,9 @@ mymain(void) { int ret = 0; +#ifndef WIN32 signal(SIGPIPE, SIG_IGN); +#endif /* WIN32 */ #define TEST_FULL(uri, uri_out, scheme, server, port, path, query, \ fragment, user, params) \