From: Remi Collet Date: Wed, 12 Apr 2017 10:56:13 +0000 (+0200) Subject: Rely on having unistd.h (which provides isatty function) X-Git-Tag: php-7.2.0alpha1~120 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=04fe5e968334913ab9d7f23df84d09c543b3a767;p=php Rely on having unistd.h (which provides isatty function) rather than having the posix extension. Fix the tests when build with --disable-all --- diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 85fa656d6d..a9bf574260 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -30,6 +30,9 @@ #include "streamsfuncs.h" #include "php_network.h" #include "php_string.h" +#if HAVE_UNISTD_H +#include +#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;