GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: fix the false isatty() issue on IBMi · nodejs/node@1743738

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@
9797
#include <unistd.h> // STDIN_FILENO, STDERR_FILENO
9898
#endif
9999

100+
#ifdef __PASE__
101+
#include <sys/ioctl.h> // ioctl
102+
#endif
100103
// ========== global C++ headers ==========
101104

102105
#include <cerrno>
@@ -521,7 +524,14 @@ inline void PlatformInit() {
521524
while (s.flags == -1 && errno == EINTR); // NOLINT
522525
CHECK_NE(s.flags, -1);
523526

527+
#ifdef __PASE__
528+
// On IBMi PASE isatty() always returns true for stdin, stdout and stderr.
529+
// Use ioctl() instead to identify whether it's actually a TTY.
530+
if (ioctl(fd, TXISATTY + 0x81, nullptr) == -1 && errno == ENOTTY)
531+
continue;
532+
#else
524533
if (!isatty(fd)) continue;
534+
#endif
525535
s.isatty = true;
526536

527537
do

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.