From 6c71f8b0d3d39beffe050f92f33a25dc30dffca3 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Fri, 22 Aug 2014 15:19:11 +0000 Subject: upload-pack: keep poll(2)'s timeout to -1 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 Acked-by: Jeff King Signed-off-by: Junio C Hamano --- upload-pack.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'upload-pack.c') diff --git a/upload-pack.c b/upload-pack.c index a3c52f691d..12c6b4d1a0 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -158,7 +158,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", -- cgit v1.2.3