summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Derigs <dl6er@dl6er.de>2021-09-23 21:12:40 +0200
committerSimon Kelley <simon@thekelleys.org.uk>2021-09-23 22:54:17 +0100
commitd9995a1add30aed4d4d34fd58ae640c205e6cdd7 (patch)
tree6b339993d6d6e2c96c9e4195c3b8f54549a2e28b
parentea7a05ad431527743688f485e3700ab321a05b52 (diff)
downloaddnsmasq-d9995a1add30aed4d4d34fd58ae640c205e6cdd7.tar.gz
Improve last patch by splitting the previously combined if
Signed-off-by: DL6ER <dl6er@dl6er.de> (also cosmetic change to logging for improved translation from Matthias Andree <matthias.andree@gmx.de>)
-rw-r--r--src/inotify.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/inotify.c b/src/inotify.c
index 7425b15..3a8e375 100644
--- a/src/inotify.c
+++ b/src/inotify.c
@@ -148,10 +148,17 @@ void set_dynamic_inotify(int flag, int total_size, struct crec **rhash, int revh
if (!(ah->flags & flag))
continue;
- if (stat(ah->fname, &buf) == -1 || !(S_ISDIR(buf.st_mode)))
+ if (stat(ah->fname, &buf) == -1)
{
my_syslog(LOG_ERR, _("bad dynamic directory %s: %s"),
- ah->fname, (S_ISDIR(buf.st_mode)) ? strerror(errno) : _("not a directory"));
+ ah->fname, strerror(errno));
+ continue;
+ }
+
+ if (!(S_ISDIR(buf.st_mode)))
+ {
+ my_syslog(LOG_ERR, _("bad dynamic directory %s: %s"),
+ ah->fname, _("not a directory"));
continue;
}