From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si9a0-0000Ne-Dj for qemu-devel@nongnu.org; Fri, 22 Jun 2012 15:31:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Si9Zy-0006dh-I9 for qemu-devel@nongnu.org; Fri, 22 Jun 2012 15:31:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37882) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si9Zy-0006dZ-9o for qemu-devel@nongnu.org; Fri, 22 Jun 2012 15:31:38 -0400 Message-ID: <4FE4C805.8000706@redhat.com> Date: Fri, 22 Jun 2012 13:31:17 -0600 From: Eric Blake MIME-Version: 1.0 References: <1340390174-7493-1-git-send-email-coreyb@linux.vnet.ibm.com> <1340390174-7493-2-git-send-email-coreyb@linux.vnet.ibm.com> In-Reply-To: <1340390174-7493-2-git-send-email-coreyb@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigED0DF4A0FFE59D3577C5C505" Subject: Re: [Qemu-devel] [PATCH v4 1/7] qemu-char: Add MSG_CMSG_CLOEXEC flag to recvmsg List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corey Bryant Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, libvir-list@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigED0DF4A0FFE59D3577C5C505 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/22/2012 12:36 PM, Corey Bryant wrote: > This sets the close-on-exec flag for the file descriptor received > via SCM_RIGHTS. >=20 > Signed-off-by: Corey Bryant > --- > v4 > -This patch is new in v4 (eblake@redhat.com) >=20 > qemu-char.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/qemu-char.c b/qemu-char.c > index c2aaaee..f890113 100644 > --- a/qemu-char.c > +++ b/qemu-char.c > @@ -2263,7 +2263,7 @@ static ssize_t tcp_chr_recv(CharDriverState *chr,= char *buf, size_t len) > msg.msg_control =3D &msg_control; > msg.msg_controllen =3D sizeof(msg_control); > =20 > - ret =3D recvmsg(s->fd, &msg, 0); > + ret =3D recvmsg(s->fd, &msg, MSG_CMSG_CLOEXEC); MSG_CMSG_CLOEXEC is not (yet) in POSIX (although it has been proposed for addition); therefore, at the moment, it only exists on Linux and Cygwin. Does this need to have conditional code to allow compilation on BSD, such as: #ifndef MSG_CMSG_CLOEXEC # define MSG_CMSG_CLOEXEC 0 #endif as well as fallback code that sets FD_CLOEXEC manually via fcntl() when MSG_CMSG_CLOEXEC is missing? --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigED0DF4A0FFE59D3577C5C505 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJP5MgHAAoJEKeha0olJ0NqUjsH/0hXp4ZiP4s8k2pG6Vl8js2t +PRer8j4f+5nYAbs5pcPVWIiuE9LbRHT0LFF4IoxwBcox66QLwmXLZavu62Xft9c cD068b935r2LnzJj4iu2oJjgA+NT4Mrx40Xb/hm3bmru7kA1F853GRhOGnxzUA2I 7dXTFcH3uCFdB+TFX+fHMMJfbuB4iD2xbf5OsYWz3yIcVgUqvh6cKZNXTum6IoNb RFe79ChS8grxK1ubPVtLgOabmGQEPZK4NEU5Kdu8tkR+JZKMYD+XdK1fNkIRki2H OOUC5aMeF6jjx5gH3y6AWVBHHkqSvy98p2Lmq4pzdYeCu2Q71pLYm4snAux+lt0= =omIN -----END PGP SIGNATURE----- --------------enigED0DF4A0FFE59D3577C5C505--