diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2009-04-26 19:26:55 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2009-04-26 19:26:55 +0200 |
commit | 17a67d9faefbff1cc7e05b82ea1981f5e14ace2c (patch) | |
tree | 29d05818cafd4f1c66a5f7c3e974ecf79570f01d /tests/network/test2_unix.c | |
parent | efbc5946bf6a8126ffaeea7a0abf54b29d3c572a (diff) | |
download | wolfbones-17a67d9faefbff1cc7e05b82ea1981f5e14ace2c.tar.gz wolfbones-17a67d9faefbff1cc7e05b82ea1981f5e14ace2c.tar.bz2 |
started to move Unix-specific networking stuff into the wolf library (out of the tests)
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; } |