aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2005-03-11 13:05:18 +0000
committerRobert Watson <rwatson@FreeBSD.org>2005-03-11 13:05:18 +0000
commitd64ac531acb0f81be1d56e10b36556e6689fbe19 (patch)
tree80a3d187952d68e0abef1d80bc0e7583ad031e33
parent7985e10d29e664397d2a21197c50d7e9d57d41a1 (diff)
downloadsrc-d64ac531acb0f81be1d56e10b36556e6689fbe19.tar.gz
src-d64ac531acb0f81be1d56e10b36556e6689fbe19.zip
Check the return value of shutdown().
Notes
Notes: svn path=/head/; revision=143413
-rw-r--r--tools/regression/sockets/sigpipe/sigpipe.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/regression/sockets/sigpipe/sigpipe.c b/tools/regression/sockets/sigpipe/sigpipe.c
index 5b46d4f88474..0422576ba20b 100644
--- a/tools/regression/sockets/sigpipe/sigpipe.c
+++ b/tools/regression/sockets/sigpipe/sigpipe.c
@@ -120,7 +120,8 @@ static void
test_send_wantsignal(const char *testname, int sock1, int sock2)
{
- shutdown(sock2, SHUT_WR);
+ if (shutdown(sock2, SHUT_WR) < 0)
+ err(-1, "%s: shutdown", testname);
signal_setup(testname);
test_send(testname, sock2);
if (!got_signal())
@@ -138,7 +139,8 @@ test_send_dontsignal(const char *testname, int sock1, int sock2)
i = 1;
if (setsockopt(sock2, SOL_SOCKET, SO_NOSIGPIPE, &i, sizeof(i)) < 0)
err(-1, "%s: setsockopt(SOL_SOCKET, SO_NOSIGPIPE)", testname);
- shutdown(sock2, SHUT_WR);
+ if (shutdown(sock2, SHUT_WR) < 0)
+ err(-1, "%s: shutdown", testname);
signal_setup(testname);
test_send(testname, sock2);
if (got_signal())
@@ -152,7 +154,8 @@ static void
test_write_wantsignal(const char *testname, int sock1, int sock2)
{
- shutdown(sock2, SHUT_WR);
+ if (shutdown(sock2, SHUT_WR) < 0)
+ err(-1, "%s: shutdown", testname);
signal_setup(testname);
test_write(testname, sock2);
if (!got_signal())
@@ -170,7 +173,8 @@ test_write_dontsignal(const char *testname, int sock1, int sock2)
i = 1;
if (setsockopt(sock2, SOL_SOCKET, SO_NOSIGPIPE, &i, sizeof(i)) < 0)
err(-1, "%s: setsockopt(SOL_SOCKET, SO_NOSIGPIPE)", testname);
- shutdown(sock2, SHUT_WR);
+ if (shutdown(sock2, SHUT_WR) < 0)
+ err(-1, "%s: shutdown", testname);
signal_setup(testname);
test_write(testname, sock2);
if (got_signal())