From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFjv8-0005hk-DO for qemu-devel@nongnu.org; Wed, 22 Jun 2016 11:18:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFjv7-0002AP-CC for qemu-devel@nongnu.org; Wed, 22 Jun 2016 11:18:26 -0400 References: <20160622080211.7126-1-famz@redhat.com> <20160622080211.7126-2-famz@redhat.com> From: Eric Blake Message-ID: <576AAC34.9050201@redhat.com> Date: Wed, 22 Jun 2016 09:18:12 -0600 MIME-Version: 1.0 In-Reply-To: <20160622080211.7126-2-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KBcClJiQwujUGeD7AOx7cGQm16jjmxlcn" Subject: Re: [Qemu-devel] [PATCH 1/2] osdep: Introduce qemu_dup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org, Max Reitz This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KBcClJiQwujUGeD7AOx7cGQm16jjmxlcn From: Eric Blake To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org, Max Reitz Message-ID: <576AAC34.9050201@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/2] osdep: Introduce qemu_dup References: <20160622080211.7126-1-famz@redhat.com> <20160622080211.7126-2-famz@redhat.com> In-Reply-To: <20160622080211.7126-2-famz@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/22/2016 02:02 AM, Fam Zheng wrote: > And use it in qemu_dup_flags. >=20 > Signed-off-by: Fam Zheng > --- > include/qemu/osdep.h | 3 +++ > util/osdep.c | 23 +++++++++++++++-------- > 2 files changed, 18 insertions(+), 8 deletions(-) > +int qemu_dup(int fd) > +{ > + int r; > +#ifdef F_DUPFD_CLOEXEC > + r =3D fcntl(fd, F_DUPFD_CLOEXEC, 0); > +#else > + r =3D dup(fd); > + if (r !=3D -1) { > + qemu_set_cloexec(raw_s->fd); Uhh, don't you mean s/raw_s->fd/r/ ? > + } > +#endif > + return r; > +} > + > static int qemu_parse_fdset(const char *param) > { > return qemu_parse_fd(param); >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --KBcClJiQwujUGeD7AOx7cGQm16jjmxlcn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXaqw0AAoJEKeha0olJ0Nq4QkH/36sagU7INiNMeUF6VhczPGF xZhSipaThRBIkgL6rwbC+QXq/Pq8dQ9bBmPk6p0z7ievgKaq4YZhtsvvIFb6TH7P 50qoXHz86nYDSOIH+r19nntR+zzQdm3mLG4GX/IW7x9G8MKCdQNTa6Nyc2haoaCk jC9HqUrl6v6La0ThgfavSG4+70O7xnhAU0ZAxwMZeZ2pCuX95CUj0RbVG9O/UuAW GE9dDo0L3LWgMbXrw4bK8XqAj1/idND0a6szLtCxAPoWGOXKxP+LL69y8Eo0c4el LexWWC5II4PJt4ukqWKn0Wnqar7bGyTYRLXRaQzbVIW9jXrnBV77pCX4g0ayvYo= =YPby -----END PGP SIGNATURE----- --KBcClJiQwujUGeD7AOx7cGQm16jjmxlcn--