From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NA10D-0008VA-J0 for qemu-devel@nongnu.org; Mon, 16 Nov 2009 07:48:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NA108-0008Ti-Qu for qemu-devel@nongnu.org; Mon, 16 Nov 2009 07:48:17 -0500 Received: from [199.232.76.173] (port=39293 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NA108-0008Tf-Mi for qemu-devel@nongnu.org; Mon, 16 Nov 2009 07:48:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20379) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NA108-0003po-74 for qemu-devel@nongnu.org; Mon, 16 Nov 2009 07:48:12 -0500 Message-ID: <4B0149C8.7040203@redhat.com> Date: Mon, 16 Nov 2009 13:47:04 +0100 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Don't leak file descriptors References: <1258125436-23759-1-git-send-email-kwolf@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org Am 13.11.2009 22:05, schrieb Blue Swirl: > On Fri, Nov 13, 2009 at 5:17 PM, Kevin Wolf wrote: >> We're leaking file descriptors to child processes. Set FD_CLOEXEC on file >> descriptors that don't need to be passed to children to stop this misbehaviour. > >> - c = accept(s, (struct sockaddr *)&addr, &addrlen); >> + c = qemu_accept(s, (struct sockaddr *)&addr, &addrlen); > > Would it be possible to improve the interface so that no casts are > needed for the calling code? How exactly would you do that? The only way I see to do it would be using void*, but I'm not sure if this really is an improvement. Kevin