diff --git a/ksh.changes b/ksh.changes index 3a30ec8..4fed802 100644 --- a/ksh.changes +++ b/ksh.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jan 24 16:06:20 UTC 2012 - werner@suse.de + +- Make sigexec using a contolling terminal + ------------------------------------------------------------------- Mon Jan 23 12:53:26 UTC 2012 - werner@suse.de diff --git a/sigexec.c b/sigexec.c index 0d07968..5320722 100644 --- a/sigexec.c +++ b/sigexec.c @@ -97,10 +97,15 @@ int main(int argc, char* argv[]) switch ((pid = fork())) { case 0: + ioctl(1, TIOCNOTTY); + if (setsid() < 0) + perror("pty: can not get controlling tty"); dup2(pts, 1); dup2(pts, 2); close(pts); close(ptm); + if (ioctl (1, TIOCSCTTY, 1) < 0) + perror("pty: can not get controlling tty"); break; case -1: close(pts);