From 2ccaf918ab4d5185066b84d4dd6050fa76afdd9e Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Mon, 23 Apr 2012 14:36:32 +0300 Subject: tests: silence warnings from pipe() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result Signed-off-by: Pekka Paalanen --- tests/sanity-test.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/sanity-test.c b/tests/sanity-test.c index 65e0144..4e6f281 100644 --- a/tests/sanity-test.c +++ b/tests/sanity-test.c @@ -91,7 +91,8 @@ FAIL_TEST(sanity_fd_leak) int fd[2]; /* leak 2 file descriptors */ - pipe(fd); + if (pipe(fd) < 0) + exit(EXIT_SUCCESS); /* failed to fail */ } FAIL_TEST(sanity_fd_leak_exec) @@ -100,7 +101,8 @@ FAIL_TEST(sanity_fd_leak_exec) int nr_fds = count_open_fds(); /* leak 2 file descriptors */ - pipe(fd); + if (pipe(fd) < 0) + exit(EXIT_SUCCESS); /* failed to fail */ exec_fd_leak_check(nr_fds); } @@ -111,7 +113,7 @@ TEST(sanity_fd_exec) int nr_fds = count_open_fds(); /* create 2 file descriptors, that should pass over exec */ - pipe(fd); + assert(pipe(fd) >= 0); exec_fd_leak_check(nr_fds + 2); } -- cgit v1.2.3