From: lace <> Date: Tue, 10 Jul 2007 14:33:06 +0000 (+0000) Subject: 2006-12-12 X-Git-Url: http://git.jankratochvil.net/?a=commitdiff_plain;h=c07be450e199207797cc3ee0a03b2b50c7cc772e;p=nethome.git 2006-12-12 --- diff --git a/src/orphanripper.c b/src/orphanripper.c index 9613b92..0b302f7 100644 --- a/src/orphanripper.c +++ b/src/orphanripper.c @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Reap any leftover children possibly holding file descriptors. - * 2006-11-30 Jan Kratochvil + * 2006-12-12 Jan Kratochvil */ @@ -56,8 +56,10 @@ static int spawn (char **argv, pid_t *child_pointer) We would rip even vi(1) in the case of: ./orphanripper sh -c 'sleep 1&' | vi - */ - if (setpgrp ()) { - perror ("setpgrp"); + /* Do not setpgrp(2) as our pty would not be ours and we would + get `SIGSTOP' later, particularly after spawning gdb(1). */ + if (getpid() != setsid ()) { + perror ("setsid"); exit (EXIT_FAILURE); } execvp (argv[1], argv + 1);