aboutsummaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2017-01-06 17:22:25 +0100
committerJunio C Hamano <gitster@pobox.com>2017-01-07 19:30:08 -0800
commit204a047f23462e4931eb00c367818d9870237827 (patch)
tree73b6d90e28f537ffe36ca8f8b3627aba14da6329 /cache.h
parent029443070a4e5b0290a2d09f3707bc486d84a961 (diff)
downloadgit-204a047f23462e4931eb00c367818d9870237827.tar.gz
git-204a047f23462e4931eb00c367818d9870237827.tar.xz
safe_create_leading_directories(): set errno on SCLD_EXISTS
The exit path for SCLD_EXISTS wasn't setting errno, which some callers use to generate error messages for the user. Fix the problem and document that the function sets errno correctly to help avoid similar regressions in the future. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/cache.h b/cache.h
index a50a61a19..8177c3a74 100644
--- a/cache.h
+++ b/cache.h
@@ -1031,8 +1031,9 @@ int adjust_shared_perm(const char *path);
/*
* Create the directory containing the named path, using care to be
- * somewhat safe against races. Return one of the scld_error values
- * to indicate success/failure.
+ * somewhat safe against races. Return one of the scld_error values to
+ * indicate success/failure. On error, set errno to describe the
+ * problem.
*
* SCLD_VANISHED indicates that one of the ancestor directories of the
* path existed at one point during the function call and then