# HG changeset patch # User Joachim Schmitz # Date 1347518484 -7200 # Node ID 723cfa7546c0e49a7f98dc929d125c0663361cc5 # Parent 1ba58228acdad5c9bd03debe0327f8ddbe08b1bc 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 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +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 diff --git a/lib/poll.c b/lib/poll.c --- a/lib/poll.c +++ b/lib/poll.c @@ -354,7 +354,7 @@ /* EFAULT is not necessary to implement, but let's do it in the simplest case. */ - if (!pfd) + if (!pfd && nfd) { errno = EFAULT; return -1;