summaryrefslogtreecommitdiffstats
path: root/pw
diff options
context:
space:
mode:
Diffstat (limited to 'pw')
-rw-r--r--pw/rm_r.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pw/rm_r.c b/pw/rm_r.c
index 172c7b0..45fc5d1 100644
--- a/pw/rm_r.c
+++ b/pw/rm_r.c
@@ -50,6 +50,9 @@ rm_r(int rootfd, const char *path, uid_t uid)
path++;
dirfd = openat(rootfd, path, O_DIRECTORY);
+ if (dirfd == -1) {
+ return;
+ }
d = fdopendir(dirfd);
while ((e = readdir(d)) != NULL) {