From: "Joachim Schmitz" <jojo@schmitz-digital.de>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: <git@vger.kernel.org>
Subject: RE: [PATCH v3 1/4] poll() exits too early with EFAULT if 1st arg is NULL
Date: Fri, 7 Sep 2012 14:52:48 +0200 [thread overview]
Message-ID: <003a01cd8cf7$af821100$0e863300$@schmitz-digital.de> (raw)
If poll() is used as a milli-second sleep, like in help.c, by passing a NULL
in the 1st and a 0 in the 2nd arg, it exits with EFAULT.
As per Paolo Bonzini, the original author, this is a bug and to be fixed like
in this commit, which is not to exit if the 2nd arg is 0.
Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>
---
compat/win32/poll.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compat/win32/poll.c b/compat/win32/poll.c
index 403eaa7..9e7a25c 100644
--- a/compat/win32/poll.c
+++ b/compat/win32/poll.c
@@ -349,7 +349,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;
--
1.7.12
next reply other threads:[~2012-09-07 12:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-07 12:52 Joachim Schmitz [this message]
2012-09-11 11:28 ` [PATCH v3 1/4] poll() exits too early with EFAULT if 1st arg is NULL Joachim Schmitz
2012-09-13 7:15 ` Joachim Schmitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='003a01cd8cf7$af821100$0e863300$@schmitz-digital.de' \
--to=jojo@schmitz-digital.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).