diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-06-22 08:30:38 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-06-22 08:30:38 -0700 |
commit | 21919d396a3a05ccb8d6b538b246500f01585bb7 (patch) | |
tree | 0b7d4710abcdb0b637557808064cd40bc3b72da6 /git-compat-util.h | |
parent | e0ae1e6f4d53c68bd219385f6f309c033d0fc673 (diff) | |
parent | 25755e842f814751fbdb7abfc8255a40f24bfaa3 (diff) | |
download | git-21919d396a3a05ccb8d6b538b246500f01585bb7.tar.gz |
Merge branch 'pc/remove-warn' into maint
* 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 c9e711872f..c0198dde4c 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -488,5 +488,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 |