poll: fix poll(0, NULL, msec)
authorJoachim Schmitz <jojo@schmitz-digital.de>
Thu, 13 Sep 2012 06:41:24 +0000 (08:41 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 13 Sep 2012 06:57:04 +0000 (08:57 +0200)
* 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

ChangeLog
lib/poll.c

index 9764b11..c724864 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
 2012-09-13  Joachim Schmitz <jojo@schmitz-digital.de>  (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 <jojo@schmitz-digital.de>  (tiny change)
            Paolo Bonzini <bonzini@gnu.org>
 
        poll: fix for systems that can't recv() on a non-socket
index b696dee..e50c478 100644 (file)
@@ -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;