make sure we remove task from controlling terminal.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29327 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2010-01-20 10:27:08 +00:00
parent 4147368f90
commit 62ca624e12
2 changed files with 27 additions and 2 deletions

View file

@ -1,8 +1,16 @@
2010-01-20 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSTask.m:
Always remove task from controlling terminal, not just when using
pseudo-terminals. This is compatible with OSX behavior
(testcase added to the testsuite).
2010-01-11 Quentin Mathe <quentin.mathe@gmail.com>
* Source/NSFormatter.m (-copyWithZone:, -initWithCoder:,
-encodeWithCoder:): Removed the subclass responsability, in order to
have subclasses automatically coding and copying compliant as Cocoa does.
-encodeWithCoder:): Removed the subclass responsibility,
in order to have subclasses automatically coding and copying
compliant as Cocoa does.
You can also now safely call [super copyWithZone:/initWithCoder:] in a
subclass.

View file

@ -1475,6 +1475,8 @@ GSPrivateCheckTasks()
/*
* Make sure task is run in it's own process group.
* This allows us to use killpg() to put the task to sleep etc,
* and have the signal effect forked children of the subtask.
*/
#ifdef HAVE_SETPGRP
#ifdef SETPGRP_VOID
@ -1503,6 +1505,8 @@ GSPrivateCheckTasks()
exit(1); /* Failed to open slave! */
}
/* Detach from controlling terminal.
*/
#ifdef HAVE_SETSID
i = setsid();
#endif
@ -1534,6 +1538,19 @@ GSPrivateCheckTasks()
}
else
{
/* Detach from controlling terminal.
*/
#ifdef HAVE_SETSID
i = setsid();
#endif
#ifdef TIOCNOTTY
i = open("/dev/tty", O_RDWR);
if (i >= 0)
{
(void)ioctl(i, TIOCNOTTY, 0);
(void)close(i);
}
#endif
/*
* Set up stdin, stdout and stderr by duplicating descriptors as
* necessary and closing the originals (to ensure we won't have a