Skip to content

Commit 18a3de4

Browse files
mhaggergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ebebeae commit 18a3de4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

credential-cache--daemon.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ static void serve_cache(const char *socket_path, int debug)
221221
; /* nothing */
222222

223223
close(fd);
224-
unlink(socket_path);
225224
}
226225

227226
static const char permissions_advice[] =
@@ -280,5 +279,7 @@ int main(int argc, const char **argv)
280279

281280
serve_cache(socket_path, debug);
282281

282+
unlink(socket_path);
283+
283284
return 0;
284285
}

0 commit comments

Comments
 (0)