On Wed, Jan 08, 2014 at 05:12:54PM +0800, Lei Li wrote: > Signed-off-by: Lei Li <li...@linux.vnet.ibm.com> > --- > fsdev/virtfs-proxy-helper.c | 51 ++++++------------------------------------ > hw/9pfs/virtio-9p-proxy.h | 5 ---- > 2 files changed, 8 insertions(+), 48 deletions(-) > > diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c > index 713a7b2..44c6e61 100644 > --- a/fsdev/virtfs-proxy-helper.c > +++ b/fsdev/virtfs-proxy-helper.c
> -static int send_fd(int sockfd, int fd) > -{ ... > - /* No ancillary data on error */ > - if (fd < 0) { > - /* fd is really negative errno if the request failed */ > - data = fd; > - } else { > - data = V9FS_FD_VALID; The way data is initialized here... > @@ -784,11 +743,17 @@ static void usage(char *prog) > static int process_reply(int sock, int type, > struct iovec *out_iovec, int retval) > { > + int data = V9FS_FD_VALID; Doesn't match what you do here. > + > switch (type) { > case T_OPEN: > case T_CREATE: > - if (send_fd(sock, retval) < 0) { > + if (qemu_send_with_fd(sock, retval, &data, sizeof(data)) < 0) { > return -1; > + } else { > + if (retval >= 0) { > + close(retval); > + } > } > break; > case T_MKNOD: Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|