* 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 <jan.kratochvil@redhat.com>
+ * 2006-12-12 Jan Kratochvil <jan.kratochvil@redhat.com>
*/
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);