diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-03-11 13:05:18 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-03-11 13:05:18 +0000 |
commit | 1fbc0d2e5290e51ca5821422869cb7282527a815 (patch) | |
tree | 80a3d187952d68e0abef1d80bc0e7583ad031e33 /tools | |
parent | d72309cdade808e436dae5798f95e35937bafb6b (diff) | |
download | FreeBSD-src-1fbc0d2e5290e51ca5821422869cb7282527a815.zip FreeBSD-src-1fbc0d2e5290e51ca5821422869cb7282527a815.tar.gz |
Check the return value of shutdown().
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/sockets/sigpipe/sigpipe.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/regression/sockets/sigpipe/sigpipe.c b/tools/regression/sockets/sigpipe/sigpipe.c index 5b46d4f..0422576 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()) |