From: Joachim Schmitz Date: Thu, 13 Sep 2012 06:41:24 +0000 (+0200) Subject: poll: fix poll(0, NULL, msec) X-Git-Tag: v0.1~444 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=c3d1ccfdb375b4cb1b912116c084a61422ef47e3;p=gnulib.git poll: fix poll(0, NULL, msec) * lib/poll.c: don't exit early if NULL is the 1st arg to poll(), but nfd is 0. In that case poll should behave like select. Copyright-paperwork-exempt: yes --- diff --git a/ChangeLog b/ChangeLog index 9764b116d..c724864c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ 2012-09-13 Joachim Schmitz (tiny change) + + poll: fix poll(0, NULL, msec) + * lib/poll.c: don't exit early if NULL is the 1st arg to poll(), + but nfd is 0. In that case poll should behave like select. + +2012-09-13 Joachim Schmitz (tiny change) Paolo Bonzini poll: fix for systems that can't recv() on a non-socket diff --git a/lib/poll.c b/lib/poll.c index b696dee0d..e50c4781f 100644 --- a/lib/poll.c +++ b/lib/poll.c @@ -354,7 +354,7 @@ poll (struct pollfd *pfd, nfds_t nfd, int timeout) /* EFAULT is not necessary to implement, but let's do it in the simplest case. */ - if (!pfd) + if (!pfd && nfd) { errno = EFAULT; return -1;