1
0
mirror of https://frontier.innolan.net/rainlance/c-ares.git synced 2025-10-05 22:10:03 +00:00

ares_process.c: fix compiler warning

This commit is contained in:
Yang Tse
2011-09-06 02:20:43 +02:00
parent a831da792d
commit 66e91438c5

View File

@ -1,6 +1,6 @@
/* Copyright 1998 by the Massachusetts Institute of Technology. /* 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 * Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without * 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) #elif defined(HAVE_IOCTL_FIONBIO)
/* older unix versions */ /* older unix versions */
int flags; int flags = nonblock ? 1 : 0;
flags = nonblock;
return ioctl(sockfd, FIONBIO, &flags); return ioctl(sockfd, FIONBIO, &flags);
#elif defined(HAVE_IOCTLSOCKET_FIONBIO) #elif defined(HAVE_IOCTLSOCKET_FIONBIO)
#ifdef WATT32 #ifdef WATT32
char flags; char flags = nonblock ? 1 : 0;
#else #else
/* Windows */ /* Windows */
unsigned long flags; unsigned long flags = nonblock ? 1UL : 0UL;
#endif #endif
flags = nonblock;
return ioctlsocket(sockfd, FIONBIO, &flags); return ioctlsocket(sockfd, FIONBIO, &flags);
#elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO) #elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO)
/* Amiga */ /* Amiga */
return IoctlSocket(sockfd, FIONBIO, (long)nonblock); long flags = nonblock ? 1L : 0L;
return IoctlSocket(sockfd, FIONBIO, flags);
#elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK) #elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK)
/* BeOS */ /* BeOS */
long b = nonblock ? 1 : 0; long b = nonblock ? 1L : 0L;
return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b)); return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
#else #else