summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-04-16 20:18:51 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-04-16 20:18:51 (GMT)
commitaebeeada3106247e74f3106a76c3cc0919aebdc7 (patch)
tree3fb4aee5c79a7c73833e2b05f6e559ea12c11630 /src
parent6bf7e1cadab7448255cb11399afdb4f66ab24666 (diff)
downloadhdf5-aebeeada3106247e74f3106a76c3cc0919aebdc7.zip
hdf5-aebeeada3106247e74f3106a76c3cc0919aebdc7.tar.gz
hdf5-aebeeada3106247e74f3106a76c3cc0919aebdc7.tar.bz2
When hlog_set_state() changes the state of an outlet, reset each
outlet's cached state so that its state is reevaluated.
Diffstat (limited to 'src')
-rw-r--r--src/hlog.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/hlog.c b/src/hlog.c
index 04050e0..d2d0e51 100644
--- a/src/hlog.c
+++ b/src/hlog.c
@@ -273,10 +273,20 @@ hlog_impl(struct hlog_outlet *ls0, const char *fmt, ...)
va_end(ap);
}
+static void
+hlog_outlet_reset_all(void)
+{
+ struct hlog_outlet *ls;
+
+ TAILQ_FOREACH(ls, &hlog_outlets, ls_next)
+ ls->ls_resolved = HLOG_OUTLET_S_PASS;
+}
+
struct hlog_outlet *
hlog_outlet_lookup(const char *name)
{
struct hlog_outlet *ls;
+
TAILQ_FOREACH(ls, &hlog_outlets, ls_next) {
if (strcmp(ls->ls_name, name) == 0)
return ls;
@@ -333,6 +343,7 @@ hlog_set_state(const char *name, hlog_outlet_state_t state, bool rendezvous)
TAILQ_INSERT_TAIL(&hlog_outlets, ls, ls_next);
}
ls->ls_state = state;
+ hlog_outlet_reset_all();
return 0;
}