From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N93L6-00060h-5C for qemu-devel@nongnu.org; Fri, 13 Nov 2009 16:05:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N93L1-0005x8-5P for qemu-devel@nongnu.org; Fri, 13 Nov 2009 16:05:51 -0500 Received: from [199.232.76.173] (port=49901 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N93L0-0005wx-US for qemu-devel@nongnu.org; Fri, 13 Nov 2009 16:05:46 -0500 Received: from mail-yx0-f188.google.com ([209.85.210.188]:48407) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N93L0-0006kw-FW for qemu-devel@nongnu.org; Fri, 13 Nov 2009 16:05:46 -0500 Received: by yxe26 with SMTP id 26so3206457yxe.4 for ; Fri, 13 Nov 2009 13:05:45 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1258125436-23759-1-git-send-email-kwolf@redhat.com> References: <1258125436-23759-1-git-send-email-kwolf@redhat.com> From: Blue Swirl Date: Fri, 13 Nov 2009 23:05:18 +0200 Message-ID: Subject: Re: [Qemu-devel] [PATCH] Don't leak file descriptors Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org 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 misbeha= viour. > - =C2=A0 =C2=A0 =C2=A0 =C2=A0c =3D accept(s, (struct sockaddr *)&addr, &a= ddrlen); > + =C2=A0 =C2=A0 =C2=A0 =C2=A0c =3D qemu_accept(s, (struct sockaddr *)&add= r, &addrlen); Would it be possible to improve the interface so that no casts are needed for the calling code?