summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2019-03-20 21:24:17 +0100
committerTor Egge <Tor.Egge@broadpark.no>2019-03-20 21:24:17 +0100
commite1f816ab68a06a4de23371d10c3916c396d32d0e (patch)
tree207b4245593e04c6eda90374951b6494eb1cdfe5 /vespalib
parentd9b643ba58fb93891e6dcb76608d20a3891fba52 (diff)
Use utility function to create nonblocking socketpair.
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/tests/net/crypto_socket/crypto_socket_test.cpp3
-rw-r--r--vespalib/src/tests/net/sync_crypto_socket/sync_crypto_socket_test.cpp3
-rw-r--r--vespalib/src/tests/portal/reactor/reactor_test.cpp3
3 files changed, 6 insertions, 3 deletions
diff --git a/vespalib/src/tests/net/crypto_socket/crypto_socket_test.cpp b/vespalib/src/tests/net/crypto_socket/crypto_socket_test.cpp
index e943ba68237..62bad716597 100644
--- a/vespalib/src/tests/net/crypto_socket/crypto_socket_test.cpp
+++ b/vespalib/src/tests/net/crypto_socket/crypto_socket_test.cpp
@@ -9,6 +9,7 @@
#include <vespa/vespalib/net/server_socket.h>
#include <vespa/vespalib/net/socket_handle.h>
#include <vespa/vespalib/net/socket_spec.h>
+#include <vespa/vespalib/net/socket_utils.h>
#include <vespa/vespalib/data/smart_buffer.h>
#include <vespa/vespalib/test/make_tls_options_for_testing.h>
#include <sys/types.h>
@@ -22,7 +23,7 @@ struct SocketPair {
SocketHandle server;
SocketPair() : client(), server() {
int sockets[2];
- ASSERT_EQUAL(0, socketpair(AF_UNIX, SOCK_STREAM | O_NONBLOCK, 0, sockets));
+ socketutils::nonblocking_socketpair(AF_UNIX, SOCK_STREAM, 0, sockets);
client.reset(sockets[0]);
server.reset(sockets[1]);
}
diff --git a/vespalib/src/tests/net/sync_crypto_socket/sync_crypto_socket_test.cpp b/vespalib/src/tests/net/sync_crypto_socket/sync_crypto_socket_test.cpp
index 20f134b3ba2..76ecd9453b6 100644
--- a/vespalib/src/tests/net/sync_crypto_socket/sync_crypto_socket_test.cpp
+++ b/vespalib/src/tests/net/sync_crypto_socket/sync_crypto_socket_test.cpp
@@ -9,6 +9,7 @@
#include <vespa/vespalib/net/server_socket.h>
#include <vespa/vespalib/net/socket_handle.h>
#include <vespa/vespalib/net/socket_spec.h>
+#include <vespa/vespalib/net/socket_utils.h>
#include <vespa/vespalib/data/smart_buffer.h>
#include <vespa/vespalib/test/make_tls_options_for_testing.h>
#include <sys/types.h>
@@ -22,7 +23,7 @@ struct SocketPair {
SocketHandle server;
SocketPair() : client(), server() {
int sockets[2];
- ASSERT_EQUAL(0, socketpair(AF_UNIX, SOCK_STREAM | O_NONBLOCK, 0, sockets));
+ socketutils::nonblocking_socketpair(AF_UNIX, SOCK_STREAM, 0, sockets);
client.reset(sockets[0]);
server.reset(sockets[1]);
}
diff --git a/vespalib/src/tests/portal/reactor/reactor_test.cpp b/vespalib/src/tests/portal/reactor/reactor_test.cpp
index 31bda119fd9..b0abc2c9e46 100644
--- a/vespalib/src/tests/portal/reactor/reactor_test.cpp
+++ b/vespalib/src/tests/portal/reactor/reactor_test.cpp
@@ -2,6 +2,7 @@
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/net/socket_handle.h>
+#include <vespa/vespalib/net/socket_utils.h>
#include <vespa/vespalib/portal/reactor.h>
#include <vespa/vespalib/util/gate.h>
@@ -20,7 +21,7 @@ struct SocketPair {
SocketHandle other;
SocketPair() : main(), other() {
int sockets[2];
- ASSERT_EQUAL(0, socketpair(AF_UNIX, SOCK_STREAM | O_NONBLOCK, 0, sockets));
+ socketutils::nonblocking_socketpair(AF_UNIX, SOCK_STREAM, 0, sockets);
main.reset(sockets[0]);
other.reset(sockets[1]);
// make main socket both readable and writable