com php-src: Rely on having unistd.h (which provides isatty function) rather than having the posix extension.: ext/standard/streamsfuncs.c
| From: | Remi Collet | Date: | Wed, 12 Apr 2017 10:56:13 +0000 |
| Subject: | com php-src: Rely on having unistd.h (which provides isatty function) rather than having the posix extension.: ext/standard/streamsfuncs.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-97571@lists.php.net to get a copy of this message | ||
Commit: 04fe5e968334913ab9d7f23df84d09c543b3a767
Author: Remi Collet <remi@php.net> Wed, 12 Apr 2017 12:56:13 +0200
Parents: efeab78535008a4640896624a1ceb8af8615535d
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=04fe5e968334913ab9d7f23df84d09c543b3a767
Log:
Rely on having unistd.h (which provides isatty function)
rather than having the posix extension.
Fix the tests when build with --disable-all
Changed paths:
M ext/standard/streamsfuncs.c
Diff:
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index 85fa656..a9bf574 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 <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;