From 04fe5e968334913ab9d7f23df84d09c543b3a767 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 12 Apr 2017 12:56:13 +0200 Subject: [PATCH] Rely on having unistd.h (which provides isatty function) rather than having the posix extension. Fix the tests when build with --disable-all --- ext/standard/streamsfuncs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.40.0