[Nbd] [PATCH] nbd-tester-client: ignore SIGPIPE so we pick up and print the error
- To: nbd-general@lists.sourceforge.net
- Subject: [Nbd] [PATCH] nbd-tester-client: ignore SIGPIPE so we pick up and print the error
- From: Alex Bligh <alex@...872...>
- Date: Sun, 5 Jun 2011 16:17:00 +0100
- Message-id: <1307287020-12440-1-git-send-email-alex@...872...>
I discovered that some test failures result in a silent exit (make check does
the right thing, but you can't see why the test failed).
Available from
http://git.alex.org.uk/
as usual.
Signed-off-by: Alex Bligh <alex@...872...>
---
nbd-tester-client.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/nbd-tester-client.c b/nbd-tester-client.c
index ed9214e..f2ebffc 100644
--- a/nbd-tester-client.c
+++ b/nbd-tester-client.c
@@ -1183,6 +1183,9 @@ int main(int argc, char**argv) {
int testflags=0;
testfunc test = throughput_test;
+ /* Ignore SIGPIPE as we want to pick up the error from write() */
+ signal (SIGPIPE, SIG_IGN);
+
if(argc<3) {
g_message("%d: Not enough arguments", (int)getpid());
g_message("%d: Usage: %s <hostname> <port>", (int)getpid(), argv[0]);
--
1.7.4.1
Reply to: