From 21f3fae46982195f88b37471896bb68668dff633 Mon Sep 17 00:00:00 2001 From: David Young Date: Thu, 16 Apr 2020 15:30:27 -0500 Subject: Refactor: extract subroutine estack_get_state() for reuse in a commit that's coming soon. --- test/vfd_swmr_common.c | 11 ++++++++++- test/vfd_swmr_common.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/test/vfd_swmr_common.c b/test/vfd_swmr_common.c index 5625dd3..f851110 100644 --- a/test/vfd_swmr_common.c +++ b/test/vfd_swmr_common.c @@ -49,10 +49,19 @@ dbgf(int level, const char *fmt, ...) estack_state_t disable_estack(void) { + estack_state_t es = estack_get_state(); + + (void)H5Eset_auto(H5E_DEFAULT, NULL, NULL); + + return es; +} + +estack_state_t +estack_get_state(void) +{ estack_state_t es; (void)H5Eget_auto(H5E_DEFAULT, &es.efunc, &es.edata); - (void)H5Eset_auto(H5E_DEFAULT, NULL, NULL); return es; } diff --git a/test/vfd_swmr_common.h b/test/vfd_swmr_common.h index 7998d29..618e4ff 100644 --- a/test/vfd_swmr_common.h +++ b/test/vfd_swmr_common.h @@ -80,6 +80,7 @@ H5TEST_DLLVAR unsigned symbol_count[NLEVELS]; extern "C" { #endif +H5TEST_DLL estack_state_t estack_get_state(void); H5TEST_DLL estack_state_t disable_estack(void); H5TEST_DLL void restore_estack(estack_state_t); -- cgit v0.12