diff options
-rw-r--r-- | git-compat-util.h | 4 | ||||
-rw-r--r-- | wrapper.c | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h index a3c453736..67ea4c89f 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -469,5 +469,9 @@ 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); #endif @@ -328,3 +328,8 @@ int unlink_or_warn(const char *file) { return warn_if_unremovable("unlink", file, unlink(file)); } + +int rmdir_or_warn(const char *file) +{ + return warn_if_unremovable("rmdir", file, rmdir(file)); +} |