On Fri, Dec 20, 2013 at 11:27 PM, Eric Blake <ebl...@redhat.com> wrote: > I noticed that recvfd() fails with errno set to EACCES if the other end > of the socket has closed (such as if it calls _exit()); but "Permission > denied" as the strerror() message doesn't read very well. Any > objections to a patch along these lines to give a nicer error message > "Transport endpoint is not connected"? Or any better errno value to > use? ECONNABORTED? ENOLINK? > > diff --git i/ChangeLog w/ChangeLog > index 25b59e3..f608556 100644 > --- i/ChangeLog > +++ w/ChangeLog > @@ -1,3 +1,8 @@ > +2013-12-21 Eric Blake <ebl...@redhat.com> > + > + passfd: give nicer error for recvfd at eof > + * lib/passfd.c (recvfd): Fake ENOTCONN if other end closes early. ...
Hi Eric, I like the idea and the patch looks fine. Two suggestions: - include your justification paragraph or similar as a comment or in the commit log. It's good to preserve that perspective for posterity. - consider adding your new test (but I suspect doing it right would require enough effort to make it not worthwhile) Thanks, Jim