[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [V6 PATCH 4/9] virtio-9p: Add qemu side interfaces for
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] Re: [V6 PATCH 4/9] virtio-9p: Add qemu side interfaces for chroot environment |
Date: |
Thu, 3 Mar 2011 11:38:10 +0000 |
On Mon, Feb 28, 2011 at 11:22 AM, M. Mohan Kumar <address@hidden> wrote:
> + retval = recvmsg(sockfd, &msg, 0);
> + if (retval < 0) {
> + *sock_error = 1;
> + return -EIO;
> + }
Are we guaranteed this will be called with signals blocked? Otherwise
we need to handle EINTR.
> + if (fd_info.fi_flags & FI_FD_SOCKERR) {
> + *sock_error = 1;
> + return -EIO;
> + }
> + /* If fd is invalid, ancillary data is not present */
> + if (fd_info.fi_fd < 0 || fd_info.fi_flags & FI_FD_INVALID) {
> + return fd_info.fi_fd;
> + }
Testing fd_info.fi_flags & FI_FD_INVALID looks dangerous to me. If
for some reason fi_fd >= 0 then we'd return success here. fd_fd < 0
should be a sufficient check, perhaps you wanted an assert() instead?
Stefan
- [Qemu-devel] Re: [V6 PATCH 4/9] virtio-9p: Add qemu side interfaces for chroot environment,
Stefan Hajnoczi <=