X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-poll.c;h=77b06d9928cc57f36db75af51dcc9aa2f859e19e;hb=b015db270e6b2937105daf6f4f632cda339c95e2;hp=f97b8d5237c4751367dc34e753eac5cff3c50d57;hpb=dcbf5fac655c77a319577e6ce6072d70445718d9;p=gnulib.git diff --git a/tests/test-poll.c b/tests/test-poll.c index f97b8d523..77b06d992 100644 --- a/tests/test-poll.c +++ b/tests/test-poll.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "sockets.h" @@ -129,11 +130,11 @@ connect_to_socket (int blocking) { #ifdef WIN32_NATIVE unsigned long iMode = 1; - ioctlsocket (s, FIONBIO, (void *) &iMode); - + ioctl (s, FIONBIO, (char *) &iMode); + #elif defined F_GETFL int oldflags = fcntl (s, F_GETFL, NULL); - + if (!(oldflags & O_NONBLOCK)) fcntl (s, F_SETFL, oldflags | O_NONBLOCK); #endif @@ -161,7 +162,7 @@ poll1 (int fd, int ev, int time) pfd.fd = fd; pfd.events = ev; pfd.revents = 0; - r = poll (&pfd, 1, time); + r = poll (&pfd, 1, time); if (r < 0) return r; @@ -359,7 +360,7 @@ main () { int result; - gl_sockets_startup (SOCKETS_2_0); + gl_sockets_startup (SOCKETS_1_1); #ifdef INTERACTIVE printf ("Please press Enter\n");