diff options
author | Daniel Beulshausen <dbeu@php.net> | 2001-09-17 13:21:10 +0000 |
---|---|---|
committer | Daniel Beulshausen <dbeu@php.net> | 2001-09-17 13:21:10 +0000 |
commit | 75aa3cfc5130fa11f99301aee7bd4c704e5a1e8e (patch) | |
tree | 2092dbe5005eb4084104f16e86aed59e007865db /ext/sockets | |
parent | 311fe215aab6db7a03b80c5aafcf87904806808f (diff) | |
download | php-git-75aa3cfc5130fa11f99301aee7bd4c704e5a1e8e.tar.gz |
fix fcntl
Diffstat (limited to 'ext/sockets')
-rw-r--r-- | ext/sockets/php_sockets_win.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/sockets/php_sockets_win.c b/ext/sockets/php_sockets_win.c index 5956781310..f352ac4b5c 100644 --- a/ext/sockets/php_sockets_win.c +++ b/ext/sockets/php_sockets_win.c @@ -151,10 +151,10 @@ int inet_aton(const char *cp, struct in_addr *inp) { } int fcntl(int fd, int cmd, ...) { - va_list va; - int retval; - - va_start(va, cmd); + va_list va; + int retval, io, mode; + + va_start(va, cmd); switch(cmd) { case F_GETFL: @@ -165,7 +165,9 @@ int fcntl(int fd, int cmd, ...) { break; case F_SETFL: - retval = ioctlsocket(fd, cmd, va_arg(va, int*)); + io = va_arg(va, int); + mode = io == O_NONBLOCK ? 1 : 0; + retval = ioctlsocket(fd, io, &mode); break; } |