From: Junio C Hamano Date: Fri, 11 Aug 2017 20:27:06 +0000 (-0700) Subject: Merge branch 'dl/credential-cache-socket-in-xdg-cache' X-Git-Tag: v2.15.0-rc0~188 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/838eaa9a225a30dd1297d354e8720560a36b7e64?hp=-c Merge branch 'dl/credential-cache-socket-in-xdg-cache' 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 --- 838eaa9a225a30dd1297d354e8720560a36b7e64 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