aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc
diff options
context:
space:
mode:
Diffstat (limited to 'erts/etc')
-rw-r--r--erts/etc/unix/run_erl.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/erts/etc/unix/run_erl.c b/erts/etc/unix/run_erl.c
index 2c69f4ee0f..6b350e8bd5 100644
--- a/erts/etc/unix/run_erl.c
+++ b/erts/etc/unix/run_erl.c
@@ -402,14 +402,17 @@ int main(int argc, char **argv)
sfd = dup(sfd);
}
}
-#if defined(HAVE_OPENPTY)
- /* sfd is from open_pty_master
- * openpty -> fork -> login_tty (forkpty)
- *
- * It would be preferable to implement a portable
- * forkpty instead of open_pty_master / open_pty_slave
- */
- /* login_tty(sfd); <- FAIL */
+#if defined(HAVE_OPENPTY) && defined(TIOCSCTTY)
+ else {
+ /* sfd is from open_pty_master
+ * openpty -> fork -> login_tty (forkpty)
+ *
+ * It would be preferable to implement a portable
+ * forkpty instead of open_pty_master / open_pty_slave
+ */
+ /* login_tty(sfd); <- FAIL */
+ ioctl(sfd, TIOCSCTTY, (char *)NULL);
+ }
#endif
#ifndef NO_SYSLOG