diff options
Diffstat (limited to 'tests/network/test2_unix.c')
-rw-r--r-- | tests/network/test2_unix.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/tests/network/test2_unix.c b/tests/network/test2_unix.c index 3964c93..dcb468c 100644 --- a/tests/network/test2_unix.c +++ b/tests/network/test2_unix.c @@ -13,7 +13,6 @@ #include <unistd.h> /* for close */ #include <errno.h> /* for errno */ -#include <fcntl.h> /* for fcntl */ #include <sys/select.h> /* for select */ #include <assert.h> /* for assertions */ #include <signal.h> /* for signal */ @@ -23,17 +22,6 @@ #define MAX_ACCEPT_IDLE_TIMEOUT 4 #define MAX_IDLE_TIMEOUT 10 -static bool wolf_network_sock_nonblocking( int fd ) { - int flags; - - flags = fcntl( fd, F_GETFL, 0 /* ignored */ ); - if( flags < 0 ) return false; - flags |= O_NONBLOCK; - flags = fcntl( fd, F_SETFL, flags ); - if( flags < 0 ) return false; - return true; -} - #if DEBUG static char *fd_set_to_string( fd_set *fd, int min_fd, int max_fd, char *buf, size_t buflen ) { int i; @@ -156,8 +144,7 @@ int main( int argc, char* argv[] ) { } /* set socket non-blocking for accepts (Stevens 15.6) */ - if( !wolf_network_sock_nonblocking( serv_fd ) ) { - fprintf( stderr, "set nonblocking failed for server socket: %s (%d)\n", strerror( errno ), errno ); + if( wolf_network_set_nonblocking( serv_fd ) != WOLF_OK ) { goto FAIL; } |