From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlhNx-0000j5-FC for qemu-devel@nongnu.org; Fri, 13 Jan 2012 08:41:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RlhNw-0003M4-A2 for qemu-devel@nongnu.org; Fri, 13 Jan 2012 08:41:37 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:54147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlhNw-0003Ly-3m for qemu-devel@nongnu.org; Fri, 13 Jan 2012 08:41:36 -0500 Received: by iaeo4 with SMTP id o4so3356466iae.4 for ; Fri, 13 Jan 2012 05:41:34 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4F103484.60705@redhat.com> Date: Fri, 13 Jan 2012 14:41:24 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20120113090951.3D333341@gandalf.tls.msk.ru> <4F1027E7.3080808@msgid.tls.msk.ru> In-Reply-To: <4F1027E7.3080808@msgid.tls.msk.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] do not chdir(/) in qemu-nbd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel@nongnu.org On 01/13/2012 01:47 PM, Michael Tokarev wrote: > But instead of adding a chdir later, I'll try to rearrange code a bit > to do all init in the parent instead. That's not possible, because when you fork you lose all threads except the main thread. That's why the daemon() was moved very early. Your patch is okay if you also add a chdir("/") later on. Paolo