From c3d1ccfdb375b4cb1b912116c084a61422ef47e3 Mon Sep 17 00:00:00 2001 From: Joachim Schmitz Date: Thu, 13 Sep 2012 08:41:24 +0200 Subject: [PATCH] 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 --- ChangeLog | 6 ++++++ lib/poll.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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; -- 2.11.0