X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=credential-cache.c;h=9a03792c7de109e957a1f01924c4f66ba87b5c87;hb=471dcfdbb23ad423168d928335bc36217f9e311d;hp=b15a9a74494c746d6f1e70b7658769c343c66576;hpb=478c44658e9c92c2c17ab4775f3c31ea713ec7de;p=git.git diff --git a/credential-cache.c b/credential-cache.c index b15a9a744..9a03792c7 100644 --- a/credential-cache.c +++ b/credential-cache.c @@ -71,10 +71,14 @@ static void do_cache(const char *socket, const char *action, int timeout, die_errno("unable to relay credential"); } - if (send_request(socket, &buf) < 0 && (flags & FLAG_SPAWN)) { - spawn_daemon(socket); - if (send_request(socket, &buf) < 0) + if (send_request(socket, &buf) < 0) { + if (errno != ENOENT && errno != ECONNREFUSED) die_errno("unable to connect to cache daemon"); + if (flags & FLAG_SPAWN) { + spawn_daemon(socket); + if (send_request(socket, &buf) < 0) + die_errno("unable to connect to cache daemon"); + } } strbuf_release(&buf); }