summaryrefslogtreecommitdiff
path: root/credential-cache.c
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2012-01-11 23:50:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-01-12 01:37:10 (GMT)
commit06121a0a8328c8aaa7a023cf6ebb142e9dc2b45c (patch)
treeb0900ae8c603123769707ea636cced6ea5998c7f /credential-cache.c
parent8ec6c8d79567a71ca3c6f1ec73eb453d371b1ade (diff)
downloadgit-06121a0a8328c8aaa7a023cf6ebb142e9dc2b45c.zip
git-06121a0a8328c8aaa7a023cf6ebb142e9dc2b45c.tar.gz
git-06121a0a8328c8aaa7a023cf6ebb142e9dc2b45c.tar.bz2
unix-socket: do not let close() or chdir() clobber errno during cleanup
unix_stream_connect and unix_stream_listen return -1 on error, with errno set by the failing underlying call to allow the caller to write a useful diagnosis. Unfortunately the error path involves a few system calls itself, such as close(), that can themselves touch errno. This is not as worrisome as it might sound. If close() fails, this just means substituting one meaningful error message for another, which is perfectly fine. However, when the call _succeeds_, it is allowed to (and sometimes might) clobber errno along the way with some undefined value, so it is good higiene to save errno and restore it immediately before returning to the caller. Do so. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'credential-cache.c')
0 files changed, 0 insertions, 0 deletions