diff --git a/tests/regressions/rhbz914931.c b/tests/regressions/rhbz914931.c index 93878dbf5..bfc8f83ea 100644 --- a/tests/regressions/rhbz914931.c +++ b/tests/regressions/rhbz914931.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -38,6 +39,7 @@ int main (int argc, char *argv[]) { + struct sigaction sa; guestfs_h *g; int r; char *str; @@ -50,6 +52,14 @@ main (int argc, char *argv[]) exit (77); } + /* This test can fail with SIGPIPE (shows up as exit code 141) + * unless we ignore that signal. + */ + memset (&sa, 0, sizeof sa); + sa.sa_handler = SIG_IGN; + sa.sa_flags = SA_RESTART; + sigaction (SIGPIPE, &sa, NULL); + g = guestfs_create (); if (!g) error (EXIT_FAILURE, errno, "guestfs_create");