]> granicus.if.org Git - php/commitdiff
fix #35079 (stream_set_blocking(true) toggles, not enables blocking)
authorAntony Dovgal <tony2001@php.net>
Thu, 17 Nov 2005 14:19:06 +0000 (14:19 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 17 Nov 2005 14:19:06 +0000 (14:19 +0000)
patch by askalski at gmail dot com

main/streams/plain_wrapper.c

index 6acb5edc86bcea96525050824281567157f8d386..83e0e74165f8d9663101b58910af9a5a1c46690e 100644 (file)
@@ -540,7 +540,7 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void
                        flags = fcntl(fd, F_GETFL, 0);
                        oldval = (flags & O_NONBLOCK) ? 0 : 1;
                        if (value)
-                               flags ^= O_NONBLOCK;
+                               flags &= ~O_NONBLOCK;
                        else
                                flags |= O_NONBLOCK;