mirror of
https://github.com/troglobit/finit.git
synced 2026-11-11 16:40:48 +00:00
Silence non-critical failure to remove /run/finit/cond/ at reboot
The directory may hold various custom generated conditions that are not managed by Finit. Not being able to remove the directory is not a critical error. finit[1]: cond_delpath():Failed removing condition path /var/run/finit/cond/: Directory not empty Therefore, ignore ENOENT and ENOTEMPTY and log everything/anything else. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
d38c333e04
commit
7bbccb1213
1 file changed
+10
-2
+10
-2
@@ -222,8 +222,16 @@ static int do_delete(const char *fpath, const struct stat *sb, int tflag, struct
|
|||||||
static void cond_delpath(const char *path)
|
static void cond_delpath(const char *path)
|
||||||
{
|
{
|
||||||
nftw(path, do_delete, 20, FTW_DEPTH);
|
nftw(path, do_delete, 20, FTW_DEPTH);
|
||||||
if (remove(path) && errno != ENOENT)
|
if (remove(path)) {
|
||||||
err(1, "Failed removing condition path %s", path);
|
switch (errno) {
|
||||||
|
case ENOENT: /* Ignore */
|
||||||
|
case ENOTEMPTY: /* Only at shutdown and for directories */
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
err(1, "Failed removing condition path %s", path);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int cond_set_path(const char *path, enum cond_state next)
|
int cond_set_path(const char *path, enum cond_state next)
|
||||||
|
|||||||
Reference in new issue
Block a user