git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] upload-pack: keep poll(2)'s timeout to -1

From
Edward Thomson <ethomson@edwardthomson.com>
Date
Aug 22, 2014, 15:19 UTC
Message-ID
<20140822151911.GA8531@debian>

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: Jeff King
Message 1 of 8 in “upload-pack: keep poll(2)'s timeout to -1”
  1. upload-pack: keep poll(2)'s timeout to -1Edward Thomson, Aug 22, 2014
  2. Jeff KingAug 22, 2014
  3. Junio C HamanoAug 22, 2014
  4. Jeff KingAug 22, 2014
  5. Edward ThomsonAug 22, 2014
  6. Junio C HamanoAug 22, 2014
  7. Junio C HamanoAug 22, 2014
  8. Junio C HamanoAug 22, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.