]> granicus.if.org Git - php/commitdiff
- MFH: Working with unintialized errno (#46917, noticed by Jost Boekemeier)
authorFelipe Pena <felipe@php.net>
Fri, 2 Jan 2009 21:28:28 +0000 (21:28 +0000)
committerFelipe Pena <felipe@php.net>
Fri, 2 Jan 2009 21:28:28 +0000 (21:28 +0000)
main/network.c

index 7d6bb61f6873628b4ea3197aa1520f5a6f82d2a2..613c070c283e9aabe16a3a849c4e11e4c2de048c 100644 (file)
@@ -1147,6 +1147,7 @@ PHPAPI int php_poll2(php_pollfd *ufds, unsigned int nfds, int timeout)
                tv.tv_sec = timeout / 1000;
                tv.tv_usec = (timeout - (tv.tv_sec * 1000)) * 1000;
        }
+       errno = 0;
        n = select(max_fd + 1, &rset, &wset, &eset, timeout >= 0 ? &tv : NULL);
 
        if (n >= 0) {