summaryrefslogtreecommitdiff
path: root/src/applyperms.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/applyperms.c')
-rw-r--r--src/applyperms.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/applyperms.c b/src/applyperms.c
index b5c10aa2..f21ee4b9 100644
--- a/src/applyperms.c
+++ b/src/applyperms.c
@@ -174,6 +174,13 @@ mkdir_v(const char *path, mode_t mode)
}
static int
+rmdir_v(const char *path)
+{
+ printf("rmdir(\"%s\")\n", path);
+ return unlinkat(rootfd, path, AT_REMOVEDIR);
+}
+
+static int
defperm(const char *name)
{
struct stat st;
@@ -265,7 +272,7 @@ specialperms(void)
/* delete directories in reverse order */
while (i > 0) {
--i;
- if (oldsp.perms[i].delete && rmdir(oldsp.perms[i].name) < 0) {
+ if (oldsp.perms[i].delete && rmdir_v(oldsp.perms[i].name) < 0) {
switch (errno) {
case ENOENT:
case ENOTEMPTY: