From 93040248410e0ef9347f5c6c9a42f8044d509abc Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 17 May 2022 14:35:42 +0200 Subject: [PATCH] Check return value of remove() when deleting full condition path Found by Coverity. Signed-off-by: Joachim Wiberg --- src/cond-w.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cond-w.c b/src/cond-w.c index 8de212e1..a4cd018f 100644 --- a/src/cond-w.c +++ b/src/cond-w.c @@ -146,10 +146,12 @@ static void cond_delpath(const char *path) while ((d = readdir(dir))) { paste(fn, sizeof(fn), path, d->d_name); - remove(fn); + if (remove(fn)) + _pe("Failed removing condition path, file %s", fn); } 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)