mirror of
https://github.com/troglobit/finit.git
synced 2026-11-24 20:21:44 +00:00
Follow-up to 9304024: skip . and ..
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
83aa6abb1c
commit
96ff9c115c
1 file changed
+5
-1
+5
-1
@@ -145,12 +145,16 @@ static void cond_delpath(const char *path)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
while ((d = readdir(dir))) {
|
while ((d = readdir(dir))) {
|
||||||
|
if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
|
||||||
|
continue;
|
||||||
|
|
||||||
paste(fn, sizeof(fn), path, d->d_name);
|
paste(fn, sizeof(fn), path, d->d_name);
|
||||||
if (remove(fn))
|
if (remove(fn))
|
||||||
_pe("Failed removing condition path, file %s", fn);
|
_pe("Failed removing condition path, file %s", fn);
|
||||||
}
|
}
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
if (unlink(path))
|
|
||||||
|
if (unlink(path) && errno != EISDIR)
|
||||||
_pe("Failed removing condition path %s", fn);
|
_pe("Failed removing condition path %s", fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user