aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-12-13 14:39:51 +0000
committerYang Tse <yangsita@gmail.com>2007-12-13 14:39:51 +0000
commit4fabe22173fe2fe05bc992c1b0746335b4f0e3d0 (patch)
tree3fdda6a3b2bf4ed2feac9c8dbc11de444b5becab
parent7b1a22147e97e06316ca8707d6177fa9187d7550 (diff)
Fix compiler warning
-rw-r--r--src/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 585d98b0c..91b6d9fb2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1439,13 +1439,12 @@ static int set_so_keepalive(void *clientp, curl_socket_t curlfd,
curlsocktype purpose)
{
struct Configurable *config = (struct Configurable *)clientp;
- int data = !config->nokeepalive;
+ int onoff = config->nokeepalive ? 0 : 1;
switch (purpose) {
case CURLSOCKTYPE_IPCXN:
- /* setsockopt()'s 5th argument is a 'socklen_t' type in POSIX, but windows
- and other pre-POSIX systems use 'int' here! */
- if (setsockopt(curlfd, SOL_SOCKET, SO_KEEPALIVE, &data, sizeof(data)) < 0) {
+ if(setsockopt(curlfd, SOL_SOCKET, SO_KEEPALIVE, (void *)&onoff,
+ sizeof(onoff)) < 0) {
warnf(clientp, "Could not set SO_KEEPALIVE!\n");
return 1;
}