aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-07-26 09:56:21 +0200
committerJohn Högberg <[email protected]>2018-07-26 09:56:21 +0200
commita0b2cc0a377d780fe938ba9be3e417c7a8e00914 (patch)
tree0d5714d31e6c67faeaaab6f76351bf3bec4a8591 /erts/emulator/sys
parentf678e1b71987075cfd7816da7e7dd828ea630115 (diff)
parent4664de710ded469916fcc8f85d4e9791adc319e9 (diff)
downloadotp-a0b2cc0a377d780fe938ba9be3e417c7a8e00914.tar.gz
otp-a0b2cc0a377d780fe938ba9be3e417c7a8e00914.tar.bz2
otp-a0b2cc0a377d780fe938ba9be3e417c7a8e00914.zip
Merge branch 'maint-21' into maint
Diffstat (limited to 'erts/emulator/sys')
-rw-r--r--erts/emulator/sys/common/erl_poll.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/erts/emulator/sys/common/erl_poll.c b/erts/emulator/sys/common/erl_poll.c
index 70b5532af9..b4d1575ee5 100644
--- a/erts/emulator/sys/common/erl_poll.c
+++ b/erts/emulator/sys/common/erl_poll.c
@@ -803,6 +803,23 @@ update_pollset(ErtsPollSet *ps, int fd, ErtsPollOp op, ErtsPollEvents events)
struct kevent evts[2];
struct timespec ts = {0, 0};
+ if (op == ERTS_POLL_OP_ADD) {
+ /* This is a hack to make the "noshell" option work; kqueue can poll
+ * these fds but will not report EV_EOF, so we return NVAL to use the
+ * fallback instead.
+ *
+ * This may be common to all pipes but we have no way to tell whether
+ * an fd is a pipe or not. */
+ switch (fd) {
+ case STDIN_FILENO:
+ case STDOUT_FILENO:
+ case STDERR_FILENO:
+ return ERTS_POLL_EV_NVAL;
+ default:
+ break;
+ }
+ }
+
#if defined(EV_DISPATCH) && !defined(__OpenBSD__)
/* If we have EV_DISPATCH we use it, unless we are on OpenBSD as the
behavior of EV_EOF seems to be edge triggered there and we need it