diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-05-09 07:32:59 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-05-09 07:32:59 +0200 |
commit | 3ecaa3b6a5f707617ea610d727c696f43f8b2f0b (patch) | |
tree | 092dc9814e12b70ae637c26e36e5d0e6813657b4 /git-compat-util.h | |
parent | cherry-pick: do not dump core when iconv fails (diff) | |
parent | Remove a redundant errno test in a usage of remove_path (diff) | |
download | git-3ecaa3b6a5f707617ea610d727c696f43f8b2f0b.tar.xz git-3ecaa3b6a5f707617ea610d727c696f43f8b2f0b.zip |
Merge branch 'pc/remove-warn'
* pc/remove-warn:
Remove a redundant errno test in a usage of remove_path
Introduce remove_or_warn function
Implement the rmdir_or_warn function
Generalise the unlink_or_warn function
Diffstat (limited to 'git-compat-util.h')
-rw-r--r-- | git-compat-util.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h index 7e62b55270..6e25977289 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -479,5 +479,14 @@ void git_qsort(void *base, size_t nmemb, size_t size, * Always returns the return value of unlink(2). */ int unlink_or_warn(const char *path); +/* + * Likewise for rmdir(2). + */ +int rmdir_or_warn(const char *path); +/* + * Calls the correct function out of {unlink,rmdir}_or_warn based on + * the supplied file mode. + */ +int remove_or_warn(unsigned int mode, const char *path); #endif |