git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] upload-pack: keep poll(2)'s timeout to -1
@ 2014-08-22 15:19 Edward Thomson
  2014-08-22 15:44 ` Jeff King
  0 siblings, 1 reply; 8+ messages in thread
From: Edward Thomson @ 2014-08-22 15:19 UTC (permalink / raw)
  To: git; +Cc: gitster, peff

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-08-22 18:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-22 15:19 [PATCH] upload-pack: keep poll(2)'s timeout to -1 Edward Thomson
2014-08-22 15:44 ` 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

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).