aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/common/erl_poll.c
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-07-26 09:56:47 +0200
committerJohn Högberg <[email protected]>2018-07-26 09:56:47 +0200
commitd9d694ca3ea8a168c51145fc485a3bcbc18f6188 (patch)
tree3ae824615ddadabdbeae2679b1aa4f717195b4b8 /erts/emulator/sys/common/erl_poll.c
parentd7e303cb7981e2ceb0eb0074cf7402feec5da868 (diff)
parenta0b2cc0a377d780fe938ba9be3e417c7a8e00914 (diff)
downloadotp-d9d694ca3ea8a168c51145fc485a3bcbc18f6188.tar.gz
otp-d9d694ca3ea8a168c51145fc485a3bcbc18f6188.tar.bz2
otp-d9d694ca3ea8a168c51145fc485a3bcbc18f6188.zip
Merge branch 'maint'
Diffstat (limited to 'erts/emulator/sys/common/erl_poll.c')
-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