Merge branch 'dl/credential-cache-socket-in-xdg-cache'
authorJunio C Hamano <gitster@pobox.com>
Fri, 11 Aug 2017 20:27:06 +0000 (13:27 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 11 Aug 2017 20:27:06 +0000 (13:27 -0700)
A recently added test for the "credential-cache" helper revealed
that EOF detection done around the time the connection to the cache
daemon is torn down were flaky. This was fixed by reacting to
ECONNRESET and behaving as if we got an EOF.

* dl/credential-cache-socket-in-xdg-cache:
credential-cache: interpret an ECONNRESET as an EOF

credential-cache.c
index 91550bfb0b3325ad92a3f3c65d5f779b61fa9951..1cccc3a0b9cfb2a14e9c87d5afc29234fa62adc4 100644 (file)
@@ -25,7 +25,7 @@ static int send_request(const char *socket, const struct strbuf *out)
                int r;
 
                r = read_in_full(fd, in, sizeof(in));
-               if (r == 0)
+               if (r == 0 || (r < 0 && errno == ECONNRESET))
                        break;
                if (r < 0)
                        die_errno("read error from cache daemon");