From 64fdfafb8b43621be85262f3c3ae43972622711d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Fri, 27 Apr 2012 20:32:35 +0200 Subject: run_erl: Set controlling terminal --- erts/etc/unix/run_erl.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'erts/etc/unix/run_erl.c') 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 -- cgit v1.2.3