From: Junio C Hamano Date: Wed, 23 Aug 2017 21:33:45 +0000 (-0700) Subject: Merge branch 'dl/credential-cache-socket-in-xdg-cache' into maint X-Git-Tag: v2.14.2~56 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/cdc55aad7d26c709cc7f64c70eb9fb9057508701?hp=-c Merge branch 'dl/credential-cache-socket-in-xdg-cache' into maint 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 --- cdc55aad7d26c709cc7f64c70eb9fb9057508701 diff --combined credential-cache.c index 91550bfb0b,3c13fe4d6a..1cccc3a0b9 --- a/credential-cache.c +++ b/credential-cache.c @@@ -25,7 -25,7 +25,7 @@@ static int send_request(const char *soc 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"); @@@ -87,7 -87,7 +87,7 @@@ static char *get_socket_path(void { struct stat sb; char *old_dir, *socket; - old_dir = expand_user_path("~/.git-credential-cache"); + old_dir = expand_user_path("~/.git-credential-cache", 0); if (old_dir && !stat(old_dir, &sb) && S_ISDIR(sb.st_mode)) socket = xstrfmt("%s/socket", old_dir); else