]> granicus.if.org Git - php/commitdiff
Rely on having unistd.h (which provides isatty function)
authorRemi Collet <remi@php.net>
Wed, 12 Apr 2017 10:56:13 +0000 (12:56 +0200)
committerRemi Collet <remi@php.net>
Wed, 12 Apr 2017 10:56:13 +0000 (12:56 +0200)
rather than having the posix extension.

Fix the tests when build with --disable-all

ext/standard/streamsfuncs.c

index 85fa656d6d5c92528ccd04ffe911ef1c4cd7313e..a9bf574260552bf27509ad148d7202e5057f9d9f 100644 (file)
@@ -30,6 +30,9 @@
 #include "streamsfuncs.h"
 #include "php_network.h"
 #include "php_string.h"
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 
 #ifndef PHP_WIN32
 #define php_select(m, r, w, e, t)      select(m, r, w, e, t)
@@ -1645,7 +1648,7 @@ PHP_FUNCTION(stream_isatty)
        else {
                RETURN_FALSE;
        }
-#elif HAVE_POSIX
+#elif HAVE_UNISTD_H
        /* Check if the file descriptor identifier is a terminal */
        if (isatty(fileno)) {
                RETURN_TRUE;