diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2015-08-10 11:47:50 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-08-12 14:50:11 -0700 |
commit | 18a3de4214668b5b82561ec096f7ef6858d25555 (patch) | |
tree | adadd2d4e406dd5fbc5a0f163be1c6e1cdaa207e /credential-cache--daemon.c | |
parent | gc: use tempfile module to handle gc.pid file (diff) | |
download | tgif-18a3de4214668b5b82561ec096f7ef6858d25555.tar.xz |
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>
Diffstat (limited to 'credential-cache--daemon.c')
-rw-r--r-- | credential-cache--daemon.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/credential-cache--daemon.c b/credential-cache--daemon.c index c2f00498f6..a671b2b53c 100644 --- a/credential-cache--daemon.c +++ b/credential-cache--daemon.c @@ -221,7 +221,6 @@ static void serve_cache(const char *socket_path, int debug) ; /* nothing */ close(fd); - unlink(socket_path); } static const char permissions_advice[] = @@ -280,5 +279,7 @@ int main(int argc, const char **argv) serve_cache(socket_path, debug); + unlink(socket_path); + return 0; } |