aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libq/xmkdir.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libq/xmkdir.c b/libq/xmkdir.c
index 9a120ae2..ed30d6d3 100644
--- a/libq/xmkdir.c
+++ b/libq/xmkdir.c
@@ -58,7 +58,7 @@ rm_rf_at(int dfd, const char *path)
dir = fdopendir(subdfd);
if (!dir) {
close(subdfd);
- return -1;
+ return unlinkat(dfd, path, 0);
}
while ((de = readdir(dir)) != NULL) {
@@ -78,6 +78,8 @@ rm_rf_at(int dfd, const char *path)
}
}
+ unlinkat(dfd, path, AT_REMOVEDIR);
+
/* this also does close(subdfd); */
closedir(dir);