Re: [bug-gnulib] Updates to poll module

2006-10-07 Thread Bruno Haible
Paolo Bonzini wrote: > 2006-09-27 Paolo Bonzini <[EMAIL PROTECTED]> > > * m4/poll.m4: Test for sys/ioctl.h and sys/filio.h. > * lib/poll.c (poll) [__APPLE__]: Use FIONREAD instead of MSG_PEEK. I took the liberty of moving this ChangeLog entry to m4/ChangeLog and lib/ChangeLog, re

Re: [bug-gnulib] Updates to poll module

2006-09-29 Thread Bruno Haible
Paolo Bonzini wrote: > How so? Only for EAGAIN and EINTR. If FIONREAD is supported, it will > return EINVAL or something like that. You're right, sorry. I was confused by the unified diffs (prefer context diffs). > >> + errno = 0; > >> > > > > What's the purpose of that? I

Re: [bug-gnulib] Updates to poll module

2006-09-28 Thread Paolo Bonzini
+ do + r = ioctl (pfd[i].fd, FIONREAD, &avail); + while (r == -1 && (errno == EAGAIN || errno == EINTR)); + if (avail < 0) + avail = 0; When ioctl returns -1, maybe because FIONREAD is not supported or so, this loops endlessl

Re: [bug-gnulib] Updates to poll module

2006-09-28 Thread Bruno Haible
Paolo Bonzini wrote: > + do > + r = ioctl (pfd[i].fd, FIONREAD, &avail); > + while (r == -1 && (errno == EAGAIN || errno == EINTR)); > + if (avail < 0) > + avail = 0; When ioctl returns -1, maybe because FIONREAD is not supported or s

Re: Updates to poll module

2006-09-28 Thread Paul Eggert
Paolo Bonzini <[EMAIL PROTECTED]> writes: > I don't have CVS access to gnulib; anyway I preferred to have a second > opinion. I added you just now. Please install that patch, as it looks good.

Re: Updates to poll module

2006-09-28 Thread Paolo Bonzini
* m4/poll.m4: Test for sys/ioctl.h and sys/filio.h. * lib/poll.c (poll) [__APPLE__]: Use FIONREAD instead of MSG_PEEK. Looks reasonable to me. But you don't need our permission to install; you're the maintainer. I don't have CVS access to gnulib; anyway I preferred to

Re: Updates to poll module

2006-09-27 Thread Paul Eggert
Paolo Bonzini <[EMAIL PROTECTED]> writes: > * m4/poll.m4: Test for sys/ioctl.h and sys/filio.h. > * lib/poll.c (poll) [__APPLE__]: Use FIONREAD instead of MSG_PEEK. Looks reasonable to me. But you don't need our permission to install; you're the maintainer.

Updates to poll module

2006-09-27 Thread Paolo Bonzini
I enclose the promised updates to the poll module in order to work around more braindeadness of the Tiger implementation of poll. recvfrom sometimes ignores MSG_PEEK on some file descriptors, e.g. pipes. We can more or less work around this using FIONREAD instead (on Mac OS X only, since the