]> granicus.if.org Git - php/commitdiff
fix datatype mismatch and unused var warning
authorAnatol Belski <ab@php.net>
Tue, 11 Nov 2014 19:16:13 +0000 (20:16 +0100)
committerAnatol Belski <ab@php.net>
Tue, 11 Nov 2014 19:16:13 +0000 (20:16 +0100)
main/network.c

index 9fd12854930b5fd5a40cee6198f088ef0789df90..f44cad29a566ab480eb7571aa14bdef543512038 100644 (file)
@@ -1126,17 +1126,19 @@ PHPAPI php_stream *_php_stream_sock_open_host(const char *host, unsigned short p
 PHPAPI int php_set_sock_blocking(php_socket_t socketd, int block TSRMLS_DC)
 {
        int ret = SUCCESS;
-       int flags;
-       int myflag = 0;
 
 #ifdef PHP_WIN32
+       u_long flags;
+
        /* with ioctlsocket, a non-zero sets nonblocking, a zero sets blocking */
        flags = !block;
        if (ioctlsocket(socketd, FIONBIO, &flags) == SOCKET_ERROR) {
                ret = FAILURE;
        }
 #else
-       flags = fcntl(socketd, F_GETFL);
+       int myflag = 0;
+       int flags = fcntl(socketd, F_GETFL);
+
 #ifdef O_NONBLOCK
        myflag = O_NONBLOCK; /* POSIX version */
 #elif defined(O_NDELAY)