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:
Joachim Wiberg
2022-05-17 14:35:42 +02:00
parent 0de5981948
commit 9304024841
+4 -2
View File
@@ -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)