1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-28 02:16:29 +02:00

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 <ethomson@microsoft.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Edward Thomson 2014-08-22 15:19:11 +00:00 committed by Junio C Hamano
parent d31f3ad23d
commit 6c71f8b0d3

View File

@ -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",