Merge branch 'et/spell-poll-infinite-with-minus-one-only'
authorJunio C Hamano <gitster@pobox.com>
Thu, 11 Sep 2014 17:33:28 +0000 (10:33 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Sep 2014 17:33:29 +0000 (10:33 -0700)
We used to pass -1000 to poll(2), expecting it to also mean "no
timeout", which should be spelled as -1.

* et/spell-poll-infinite-with-minus-one-only:
upload-pack: keep poll(2)'s timeout to -1

upload-pack.c
index c9ea1d3be668f9beeac408dfdf5ceea90c4a6ca8..c789ec00507696b4e52b081b66cc0e7c8cba42f9 100644 (file)
@@ -166,7 +166,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",