summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-08-21 14:52:07 -0700
committerJunio C Hamano <gitster@pobox.com>2012-08-21 14:52:07 -0700
commit55b38a48e2a7ccfaaa7897a5fccb98327fa0e3c0 (patch)
tree54ba6e46f12bccd1af9faf258d9826a8001b22e6 /git-compat-util.h
parent11e50b2736f374f1608e0c5690405be1a74aa16d (diff)
downloadgit-55b38a48e2a7ccfaaa7897a5fccb98327fa0e3c0.tar.gz
warn_on_inaccessible(): a helper to warn on inaccessible paths
The previous series introduced warnings to multiple places, but it could become tiring to see the warning on the same path over and over again during a single run of Git. Making just one function responsible for issuing this warning, we could later choose to keep track of which paths we issued a warning (it would involve a hash table of paths after running them through real_path() or something) in order to reduce noise. Right now we do not know if the noise reduction is necessary, but it still would be a good code reduction/sharing anyway. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 5a520e2b73..000042d793 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -607,6 +607,9 @@ int remove_or_warn(unsigned int mode, const char *path);
/* Call access(2), but warn for any error besides ENOENT. */
int access_or_warn(const char *path, int mode);
+/* Warn on an inaccessible file that ought to be accessible */
+void warn_on_inaccessible(const char *path);
+
/* Get the passwd entry for the UID of the current process. */
struct passwd *xgetpwuid_self(void);