diff options
Diffstat (limited to 'vespalib/src')
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 |