Skip to contentSkip to conversation

slirp: Put forked exec into separate process group

PATCH New Jan Kiszka 1 participant 1 message May 30, 2011

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 slirp: Put forked exec into separate process group

From: Jan Kiszka <[email protected]>

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.

---
 slirp/misc.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
slirp/misc.c +2 -1
index 08eba6a..34179e2 100644
@@ -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 {
Signature · 1 line
1.7.1