mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
libthread: call setpgrp in programs that will background
This fixes the 'run stats from rc; exit rc; stats dies' problem. It's unclear whether this is the right fix or whether rc should be starting all its interactive commands in their own process groups. But at least it does fix stats dying.
This commit is contained in:
parent
3ccd61629b
commit
52b599a63c
1 changed files with 7 additions and 0 deletions
|
@ -101,6 +101,13 @@ _threadsetupdaemonize(void)
|
||||||
|
|
||||||
sigpid = 1;
|
sigpid = 1;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We've been told this program is likely to background itself.
|
||||||
|
* Put it in its own process group so that we don't get a SIGHUP
|
||||||
|
* when the parent exits.
|
||||||
|
*/
|
||||||
|
setpgrp();
|
||||||
|
|
||||||
if(pipe(p) < 0)
|
if(pipe(p) < 0)
|
||||||
sysfatal("passer pipe: %r");
|
sysfatal("passer pipe: %r");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue