From patchwork Mon May 30 20:21:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 97953 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3CED0B6F6E for ; Tue, 31 May 2011 06:21:33 +1000 (EST) Received: from localhost ([::1]:38740 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QR8xt-0000YP-Ty for incoming@patchwork.ozlabs.org; Mon, 30 May 2011 16:21:29 -0400 Received: from eggs.gnu.org ([140.186.70.92]:50874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QR8xl-0000Y5-Pu for qemu-devel@nongnu.org; Mon, 30 May 2011 16:21:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QR8xk-0005j4-FX for qemu-devel@nongnu.org; Mon, 30 May 2011 16:21:21 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:49632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QR8xk-0005iy-0X for qemu-devel@nongnu.org; Mon, 30 May 2011 16:21:20 -0400 Received: from smtp06.web.de ( [172.20.5.172]) by fmmailgate01.web.de (Postfix) with ESMTP id A066118FB0D18 for ; Mon, 30 May 2011 22:21:18 +0200 (CEST) Received: from [92.75.140.119] (helo=mchn199C.mchp.siemens.de) by smtp06.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #2) id 1QR8xi-0008F6-00 for qemu-devel@nongnu.org; Mon, 30 May 2011 22:21:18 +0200 Message-ID: <4DE3FC3D.7070409@web.de> Date: Mon, 30 May 2011 22:21:17 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: qemu-devel X-Enigmail-Version: 1.1.2 X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX1+quWnAyDJnpY9027JYzHVl8IzlTREz1xa2uZpL uQ/ES6R/sTeZ0Ns5kbw7n475W9mDO7Feg+s2iYQ6KCNqfDM/oT udfI5bQ/Q= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 217.72.192.221 Subject: [Qemu-devel] [PATCH] slirp: Put forked exec into separate process group X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jan Kiszka 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 --- slirp/misc.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/slirp/misc.c b/slirp/misc.c index 08eba6a..34179e2 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 {