Skip to content

Commit

Permalink
slirp: Put forked exec into separate process group
Browse files Browse the repository at this point in the history
Recent smb daemons tend to terminate themselves via a process group
SIGTERM. If the daemon is still in qemu's group by that time, qemu will
die as well. Avoid this by always pushing fork_exec processes into a
group of their own, not just (unused) type 2 execs.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
  • Loading branch information
jan-kiszka authored and Anthony Liguori committed Jul 23, 2011
1 parent 3acccfc commit 565465f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion slirp/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,12 @@ fork_exec(struct socket *so, const char *ex, int do_pty)
return 0;

case 0:
setsid();

/* Set the DISPLAY */
if (do_pty == 2) {
(void) close(master);
#ifdef TIOCSCTTY /* XXXXX */
(void) setsid();
ioctl(s, TIOCSCTTY, (char *)NULL);
#endif
} else {
Expand Down

0 comments on commit 565465f

Please sign in to comment.