summaryrefslogtreecommitdiffstats
path: root/slirp
diff options
context:
space:
mode:
authorJan Kiszka2011-07-20 12:20:17 +0200
committerAnthony Liguori2011-07-23 17:19:49 +0200
commit565465fcae755fbdb11c2f65ec5f0ae62c78db3a (patch)
treec0f291700cca255385118753234f62f426c691c1 /slirp
parentslirp: Replace m_freem with m_free (diff)
downloadqemu-565465fcae755fbdb11c2f65ec5f0ae62c78db3a.tar.gz
qemu-565465fcae755fbdb11c2f65ec5f0ae62c78db3a.tar.xz
qemu-565465fcae755fbdb11c2f65ec5f0ae62c78db3a.zip
slirp: Put forked exec into separate process group
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>
Diffstat (limited to 'slirp')
-rw-r--r--slirp/misc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/slirp/misc.c b/slirp/misc.c
index 08eba6adc0..34179e26a8 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -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 {