On Mon, Feb 28, 2011 at 11:22 AM, M. Mohan Kumar <mo...@in.ibm.com> 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