summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 10e13ec)
raw | patch | inline | side by side (parent: 10e13ec)
author | Peter Collingbourne <peter@pcc.me.uk> | |
Fri, 26 Mar 2010 15:25:33 +0000 (15:25 +0000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 28 Mar 2010 16:53:01 +0000 (09:53 -0700) |
This patch implements an rmdir_or_warn function (like unlink_or_warn
but for directories) that uses the generalised warning code in
warn_if_unremovable.
Signed-off-by: Peter Collingbourne <peter@pcc.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
but for directories) that uses the generalised warning code in
warn_if_unremovable.
Signed-off-by: Peter Collingbourne <peter@pcc.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-compat-util.h | patch | blob | history | |
wrapper.c | patch | blob | history |
diff --git a/git-compat-util.h b/git-compat-util.h
index a3c45373669cd8482c04d5815862ed36a153572d..67ea4c89f5f9db58bf5bf5dcde9d76e6fc511475 100644 (file)
--- a/git-compat-util.h
+++ b/git-compat-util.h
* 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
diff --git a/wrapper.c b/wrapper.c
index 0bbff56e2c38651b10551d17caeed84e0cc250c8..4017bff6bb3f658ed745da4f9a3a7a79fb38fb08 100644 (file)
--- a/wrapper.c
+++ b/wrapper.c
{
return warn_if_unremovable("unlink", file, unlink(file));
}
+
+int rmdir_or_warn(const char *file)
+{
+ return warn_if_unremovable("rmdir", file, rmdir(file));
+}