Re: [libvirt] [PATCH 1/6] Add API for duplicating a socket/client file descriptor

2011-08-15 Thread Eric Blake
On 08/15/2011 06:57 AM, Jiri Denemark wrote: Except you missed one change I had pointed out there: bootstrap.conf needs to list 'fcntl' in the list of gnulib modules (without it, gnulib doesn't guarantee that F_DUPFD_CLOEXEC will work on mingw). Hmm, I saw fcntl-h in bootstrap.conf, is that som

Re: [libvirt] [PATCH 1/6] Add API for duplicating a socket/client file descriptor

2011-08-15 Thread Jiri Denemark
On Mon, Aug 15, 2011 at 06:49:58 -0600, Eric Blake wrote: > On 08/15/2011 03:43 AM, Jiri Denemark wrote: > > On Mon, Aug 15, 2011 at 09:58:11 +0200, Jiri Denemark wrote: > >> From: "Daniel P. Berrange" > >> > >> * src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Add > >>virNetSocketDupFD() > >>

Re: [libvirt] [PATCH 1/6] Add API for duplicating a socket/client file descriptor

2011-08-15 Thread Eric Blake
On 08/15/2011 03:43 AM, Jiri Denemark wrote: On Mon, Aug 15, 2011 at 09:58:11 +0200, Jiri Denemark wrote: From: "Daniel P. Berrange" * src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Add virNetSocketDupFD() * src/rpc/virnetclient.c, src/rpc/virnetclient.h: Add virNetClientDupFD() and virN

Re: [libvirt] [PATCH 1/6] Add API for duplicating a socket/client file descriptor

2011-08-15 Thread Jiri Denemark
On Mon, Aug 15, 2011 at 06:42:15 -0600, Eric Blake wrote: > On 08/15/2011 01:58 AM, Jiri Denemark wrote: > > @@ -710,6 +711,23 @@ int virNetSocketGetFD(virNetSocketPtr sock) > > } > > > > > > +int virNetSocketDupFD(virNetSocketPtr sock, bool cloexec) > > +{ > > +int fd; > > + > > +if (clo

Re: [libvirt] [PATCH 1/6] Add API for duplicating a socket/client file descriptor

2011-08-15 Thread Eric Blake
On 08/15/2011 01:58 AM, Jiri Denemark wrote: @@ -710,6 +711,23 @@ int virNetSocketGetFD(virNetSocketPtr sock) } +int virNetSocketDupFD(virNetSocketPtr sock, bool cloexec) +{ +int fd; + +if (cloexec) +fd = fcntl(sock->fd, F_DUPFD_CLOEXEC, (long) 0); The third argument is unne

Re: [libvirt] [PATCH 1/6] Add API for duplicating a socket/client file descriptor

2011-08-15 Thread Jiri Denemark
On Mon, Aug 15, 2011 at 09:58:11 +0200, Jiri Denemark wrote: > From: "Daniel P. Berrange" > > * src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Add > virNetSocketDupFD() > * src/rpc/virnetclient.c, src/rpc/virnetclient.h: Add > virNetClientDupFD() and virNetClientGetFD() > --- Ah, I forgot t

Re: [libvirt] [PATCH 1/6] Add API for duplicating a socket/client file descriptor

2011-08-15 Thread Daniel Veillard
On Mon, Aug 15, 2011 at 09:58:11AM +0200, Jiri Denemark wrote: > From: "Daniel P. Berrange" > > * src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Add > virNetSocketDupFD() > * src/rpc/virnetclient.c, src/rpc/virnetclient.h: Add > virNetClientDupFD() and virNetClientGetFD() > --- > src/rpc/vi

[libvirt] [PATCH 1/6] Add API for duplicating a socket/client file descriptor

2011-08-15 Thread Jiri Denemark
From: "Daniel P. Berrange" * src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Add virNetSocketDupFD() * src/rpc/virnetclient.c, src/rpc/virnetclient.h: Add virNetClientDupFD() and virNetClientGetFD() --- src/rpc/virnetclient.c | 20 src/rpc/virnetclient.h |3 +++ sr