]> granicus.if.org Git - curl/commitdiff
nonblock: fix setting non-blocking mode for Amiga
authorDaniel Stenberg <daniel@haxx.se>
Fri, 27 Nov 2015 22:29:30 +0000 (23:29 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 27 Nov 2015 22:29:30 +0000 (23:29 +0100)
IoctlSocket() apparently wants a pointer to a long, passed as a char *
in its third parameter. This bug was introduced already back in commit
c5fdeef41d from October 1 2001!

Bug: http://curl.haxx.se/mail/lib-2015-11/0088.html
Reported-by: Norbert Kett
lib/nonblock.c

index 1447c877df4f8888bd1c138b1534c99db7291b52..189fc5dea2d48a2ff20f6f527dae96889d4fb208 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -77,7 +77,7 @@ int curlx_nonblock(curl_socket_t sockfd,    /* operate on this */
 
   /* Amiga */
   long flags = nonblock ? 1L : 0L;
-  return IoctlSocket(sockfd, FIONBIO, flags);
+  return IoctlSocket(sockfd, FIONBIO, (char *)&flags);
 
 #elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK)