From bda4da71a68c2cf51765c0354f9d3163a90a0a41 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Mon, 29 Mar 2021 23:15:36 +0200 Subject: [PATCH] Fix touch-reload regression from 3bb1e41 When reloading we check if service .conf files have been modified since the last time we read them. In 3bb1e41 we changed it so we load only the enabled/*.conf files, which led to our no longer properly detecting changed files since we monitor changes in what the symlinks point to. This patch fixes that by checking the target for changes. Signed-off-by: Joachim Wiberg --- src/conf.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/conf.c b/src/conf.c index 1fa6d5b4..5750aac3 100644 --- a/src/conf.c +++ b/src/conf.c @@ -792,13 +792,21 @@ int conf_any_change(void) int conf_changed(char *file) { + int rc = 0; + char *rp; + if (!file) return 0; - if (conf_find(file)) - return 1; + rp = realpath(file, NULL); + if (!rp) + return 0; - return 0; + if (conf_find(rp)) + rc = 1; + free(rp); + + return rc; } static void conf_cb(uev_t *w, void *arg, int events)