Skip to content

Commit 6534c6c

Browse files
cjihrigMylesBorins
authored andcommitted
src: use uv_guess_handle() to detect TTYs
This commit reverts #30829 and uses uv_guess_handle() instead of isatty(). The IBMi changes are no longer required, as of libuv 1.34.1. PR-URL: #31333 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 6d6a3e4 commit 6534c6c

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/node.cc

+1-11
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,6 @@
109109
#include <unistd.h> // STDIN_FILENO, STDERR_FILENO
110110
#endif
111111

112-
#ifdef __PASE__
113-
#include <sys/ioctl.h> // ioctl
114-
#endif
115112
// ========== global C++ headers ==========
116113

117114
#include <cerrno>
@@ -589,14 +586,7 @@ inline void PlatformInit() {
589586
while (s.flags == -1 && errno == EINTR); // NOLINT
590587
CHECK_NE(s.flags, -1);
591588

592-
#ifdef __PASE__
593-
// On IBMi PASE isatty() always returns true for stdin, stdout and stderr.
594-
// Use ioctl() instead to identify whether it's actually a TTY.
595-
if (ioctl(fd, TXISATTY + 0x81, nullptr) == -1 && errno == ENOTTY)
596-
continue;
597-
#else
598-
if (!isatty(fd)) continue;
599-
#endif
589+
if (uv_guess_handle(fd) != UV_TTY) continue;
600590
s.isatty = true;
601591

602592
do

0 commit comments

Comments
 (0)