summaryrefslogtreecommitdiff
path: root/ares_process.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-09-06 02:20:43 +0200
committerYang Tse <yangsita@gmail.com>2011-09-06 02:20:43 +0200
commit66e91438c5bee15c765f5ea97c9006f747d06a7f (patch)
treec8f0accd2d8976fd2a8590b8641214e235b554af /ares_process.c
parenta831da792d627d9b351b9418dbc238cca7cd71fd (diff)
downloadc-ares-66e91438c5bee15c765f5ea97c9006f747d06a7f.tar.gz
c-ares-66e91438c5bee15c765f5ea97c9006f747d06a7f.tar.bz2
c-ares-66e91438c5bee15c765f5ea97c9006f747d06a7f.zip
ares_process.c: fix compiler warning
Diffstat (limited to 'ares_process.c')
-rw-r--r--ares_process.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/ares_process.c b/ares_process.c
index e5efa5f..5de1ae6 100644
--- a/ares_process.c
+++ b/ares_process.c
@@ -1,6 +1,6 @@
/* Copyright 1998 by the Massachusetts Institute of Technology.
- * Copyright (C) 2004-2010 by Daniel Stenberg
+ * Copyright (C) 2004-2011 by Daniel Stenberg
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
@@ -837,30 +837,29 @@ static int setsocknonblock(ares_socket_t sockfd, /* operate on this */
#elif defined(HAVE_IOCTL_FIONBIO)
/* older unix versions */
- int flags;
- flags = nonblock;
+ int flags = nonblock ? 1 : 0;
return ioctl(sockfd, FIONBIO, &flags);
#elif defined(HAVE_IOCTLSOCKET_FIONBIO)
#ifdef WATT32
- char flags;
+ char flags = nonblock ? 1 : 0;
#else
/* Windows */
- unsigned long flags;
+ unsigned long flags = nonblock ? 1UL : 0UL;
#endif
- flags = nonblock;
return ioctlsocket(sockfd, FIONBIO, &flags);
#elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO)
/* Amiga */
- return IoctlSocket(sockfd, FIONBIO, (long)nonblock);
+ long flags = nonblock ? 1L : 0L;
+ return IoctlSocket(sockfd, FIONBIO, flags);
#elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK)
/* BeOS */
- long b = nonblock ? 1 : 0;
+ long b = nonblock ? 1L : 0L;
return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
#else