]> Savannah Git Hosting - gnulib.git/commitdiff
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 9764b116d398b1fd1ed7ed28293bd80347a4edf2..c724864c5062a438616bb620d0a8e793ba85ad3f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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>
 
index b696dee0d63fa11db32626e2b1bff52f070fccf9..e50c4781fc94266e25cf6fc0be050f60aae233d2 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;