Skip to content

Commit 6c71f8b

Browse files
ethomsongitster
authored andcommitted
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 <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d31f3ad commit 6c71f8b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

upload-pack.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ static void create_pack_file(void)
158158
if (!pollsize)
159159
break;
160160

161-
ret = poll(pfd, pollsize, 1000 * keepalive);
161+
ret = poll(pfd, pollsize,
162+
keepalive < 0 ? -1 : 1000 * keepalive);
163+
162164
if (ret < 0) {
163165
if (errno != EINTR) {
164166
error("poll failed, resuming: %s",

0 commit comments

Comments
 (0)