Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'jk/credential-cache-comment-exit'
A code clarification.

* jk/credential-cache-comment-exit:
  credential-cache--daemon: clarify "exit" action semantics
  • Loading branch information
Junio C Hamano committed Apr 6, 2016
2 parents 2f03d17 + 7d5e9c9 commit 67827f5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion credential-cache--daemon.c
Expand Up @@ -126,8 +126,17 @@ static void serve_one_client(FILE *in, FILE *out)
fprintf(out, "password=%s\n", e->item.password);
}
}
else if (!strcmp(action.buf, "exit"))
else if (!strcmp(action.buf, "exit")) {
/*
* It's important that we clean up our socket first, and then
* signal the client only once we have finished the cleanup.
* Calling exit() directly does this, because we clean up in
* our atexit() handler, and then signal the client when our
* process actually ends, which closes the socket and gives
* them EOF.
*/
exit(0);
}
else if (!strcmp(action.buf, "erase"))
remove_credential(&c);
else if (!strcmp(action.buf, "store")) {
Expand Down

0 comments on commit 67827f5

Please sign in to comment.