From: Edward Thomson <ethomson@edwardthomson.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, peff@peff.net
Subject: [PATCH] upload-pack: keep poll(2)'s timeout to -1
Date: Fri, 22 Aug 2014 15:19:11 +0000 [thread overview]
Message-ID: <20140822151911.GA8531@debian> (raw)
Keep poll's timeout at -1 when uploadpack.keepalive = 0, instead of
setting it to -1000, since some pedantic old systems (eg HP-UX) and
the gnulib compat/poll will treat only -1 as the valid value for
an infinite timeout.
Signed-off-by: Edward Thomson <ethomson@microsoft.com>
---
upload-pack.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/upload-pack.c b/upload-pack.c
index 01de944..433211a 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -167,7 +167,9 @@ static void create_pack_file(void)
if (!pollsize)
break;
- ret = poll(pfd, pollsize, 1000 * keepalive);
+ ret = poll(pfd, pollsize,
+ keepalive < 0 ? -1 : 1000 * keepalive);
+
if (ret < 0) {
if (errno != EINTR) {
error("poll failed, resuming: %s",
--
1.7.10.4
next reply other threads:[~2014-08-22 15:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-22 15:19 Edward Thomson [this message]
2014-08-22 15:44 ` [PATCH] upload-pack: keep poll(2)'s timeout to -1 Jeff King
2014-08-22 15:56 ` Junio C Hamano
2014-08-22 16:03 ` Jeff King
2014-08-22 16:27 ` Edward Thomson
2014-08-22 18:26 ` Junio C Hamano
2014-08-22 18:19 ` Junio C Hamano
2014-08-22 18:21 ` Junio C Hamano
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=20140822151911.GA8531@debian \
--to=ethomson@edwardthomson.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/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).