]> git.proxmox.com Git - qemu.git/commitdiff
slirp: Put forked exec into separate process group
authorJan Kiszka <jan.kiszka@siemens.com>
Wed, 20 Jul 2011 10:20:17 +0000 (12:20 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Sat, 23 Jul 2011 15:19:49 +0000 (10:19 -0500)
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>
slirp/misc.c

index 08eba6adc0d8ae29e36d115ddb2568186445db8a..34179e26a84ca9a528cf94d074538542ab7230d0 100644 (file)
@@ -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 {