From c07be450e199207797cc3ee0a03b2b50c7cc772e Mon Sep 17 00:00:00 2001 From: lace <> Date: Tue, 10 Jul 2007 14:33:06 +0000 Subject: [PATCH 1/1] 2006-12-12 --- src/orphanripper.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); -- 1.8.3.1