aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoe Mason <jmason@rim.com>2012-08-06 12:36:08 -0400
committerDaniel Stenberg <daniel@haxx.se>2012-08-07 00:21:14 +0200
commit66a77a9b4904deafc308f152842329eccf9b2ad4 (patch)
treef3db5b88c69b03351a0d0150b9c4fc0708ad35b9 /tests
parent3b9103e4a69943b0b76e53a8d12e7de38ef88841 (diff)
Use cross-platform curlx_nonblock instead of fcntl in sws
Diffstat (limited to 'tests')
-rw-r--r--tests/server/sws.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/server/sws.c b/tests/server/sws.c
index fc0d0ddf3..f01e75744 100644
--- a/tests/server/sws.c
+++ b/tests/server/sws.c
@@ -50,7 +50,6 @@
#include <netinet/tcp.h> /* for TCP_NODELAY */
#endif
-#include <fcntl.h>
#include <poll.h>
#define ENABLE_CURLX_PRINTF
@@ -1742,9 +1741,9 @@ static int accept_connection(int sock)
return CURL_SOCKET_BAD;
}
- if(0 != fcntl(msgsock, F_SETFL, O_NONBLOCK)) {
+ if(0 != curlx_nonblock(msgsock, TRUE)) {
error = SOCKERRNO;
- logmsg("fcntl(O_NONBLOCK) failed with error: (%d) %s",
+ logmsg("curlx_nonblock failed with error: (%d) %s",
error, strerror(error));
sclose(msgsock);
return CURL_SOCKET_BAD;
@@ -2004,9 +2003,9 @@ int main(int argc, char *argv[])
error, strerror(error));
goto sws_cleanup;
}
- if(0 != fcntl(sock, F_SETFL, O_NONBLOCK)) {
+ if(0 != curlx_nonblock(sock, TRUE)) {
error = SOCKERRNO;
- logmsg("fcntl(O_NONBLOCK) failed with error: (%d) %s",
+ logmsg("curlx_nonblock failed with error: (%d) %s",
error, strerror(error));
goto sws_cleanup;
}