On 06/22/2016 02:02 AM, Fam Zheng wrote: > And use it in qemu_dup_flags. > > Signed-off-by: Fam Zheng <[email protected]> > --- > 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 = fcntl(fd, F_DUPFD_CLOEXEC, 0);
> +#else
> + r = dup(fd);
> + if (r != -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);
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
