credential-cache--daemon: delete socket from main()
main() is responsible for cleaning up the socket in the case of errors, so it is reasonable to also make it responsible for cleaning it up when there are no errors. This change also makes the next step easier. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty committed
Aug 10, 2015 at 11:47 UTC
18a3de4214668b5b82561ec096f7ef6858d25555
1 file changed
+2
-1
credential-cache--daemon.c
+2
-1
@@ -221,7 +221,6 @@ static void serve_cache(const char *socket_path, int debug)
221
; /* nothing */
222
223
close(fd);
224
- unlink(socket_path);
224
}
225
226
static const char permissions_advice[] =
@@ -280,5 +279,7 @@ int main(int argc, const char **argv)
279
280
serve_cache(socket_path, debug);
281
282
+ unlink(socket_path);
283
+
284
return 0;
285
}