Skip to content

Commit

Permalink
Rely on having unistd.h (which provides isatty function)
Browse files Browse the repository at this point in the history
rather than having the posix extension.

Fix the tests when build with --disable-all
  • Loading branch information
remicollet committed Apr 12, 2017
1 parent efeab78 commit 04fe5e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ext/standard/streamsfuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

1 comment on commit 04fe5e9

@weltling
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! The point was not about ext/posix, but aobut checking the POSIX complaint functionality. Obviously we should not depend on ext/posix for the very core.

Please sign in to comment.