From ed999d9a80cb74eb7f1d5775e1bce11cccc41f8e Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 26 Apr 2022 18:57:51 +0200 Subject: [PATCH] Fix log regression introduced in 82cc10be Signed-off-by: Joachim Wiberg --- src/cond-w.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cond-w.c b/src/cond-w.c index e68e2b92..8de212e1 100644 --- a/src/cond-w.c +++ b/src/cond-w.c @@ -176,10 +176,16 @@ int cond_set_path(const char *path, enum cond_state next) case COND_OFF: if (unlink(path)) { - if (errno == ENOENT) - _pe("Failed removing condition '%s'", path); - if (errno == EISDIR) + switch (errno) { + case ENOENT: + break; + case EISDIR: cond_delpath(path); + break; + default: + _pe("Failed removing condition '%s'", path); + break; + } } break;