mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 21:42:40 +07:00
Check return value of remove() when deleting full condition path
Found by Coverity. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+4
-2
@@ -146,10 +146,12 @@ static void cond_delpath(const char *path)
|
|||||||
|
|
||||||
while ((d = readdir(dir))) {
|
while ((d = readdir(dir))) {
|
||||||
paste(fn, sizeof(fn), path, d->d_name);
|
paste(fn, sizeof(fn), path, d->d_name);
|
||||||
remove(fn);
|
if (remove(fn))
|
||||||
|
_pe("Failed removing condition path, file %s", fn);
|
||||||
}
|
}
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
unlink(path);
|
if (unlink(path))
|
||||||
|
_pe("Failed removing condition path %s", fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
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