aboutsummaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-07-20 12:20:17 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2011-07-23 10:19:49 -0500
commitaf35375b6d600cf553f0d0748b2a10ff7dbf6142 (patch)
tree1f9e7f5d2d6db1788c628d7f7bfd8f8b068ccd60 /misc.c
parentb0f74a483d5ca50dda42959133a34f1ca72deaa3 (diff)
downloadslirp-af35375b6d600cf553f0d0748b2a10ff7dbf6142.zip
slirp-af35375b6d600cf553f0d0748b2a10ff7dbf6142.tar.gz
slirp-af35375b6d600cf553f0d0748b2a10ff7dbf6142.tar.bz2
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 'misc.c')
-rw-r--r--misc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/misc.c b/misc.c
index e4cf46b..a3643fd 100644
--- a/misc.c
+++ b/misc.c
@@ -146,11 +146,12 @@ int 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 {