Changeset: 964f536a760b for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/964f536a760b Modified Files: gdk/gdk_tracer.c Branch: Jul2021 Log Message:
Don't do any kind of work inside a signal handler. diffs (33 lines): diff --git a/gdk/gdk_tracer.c b/gdk/gdk_tracer.c --- a/gdk/gdk_tracer.c +++ b/gdk/gdk_tracer.c @@ -250,10 +250,19 @@ find_component(const char *comp) * API CALLS * */ +static volatile sig_atomic_t interrupted = 0; + void GDKtracer_reinit_basic(int sig) { (void) sig; + interrupted = 1; +} + +static void +reinit(void) +{ + interrupted = 0; // GDKtracer needs to reopen the file only in // case the adapter is BASIC @@ -462,6 +471,9 @@ GDKtracer_log(const char *file, const ch static char file_prefix[] = __FILE__; static size_t prefix_length = (size_t) -1; + if (interrupted) + reinit(); + if (prefix_length == (size_t) -1) { /* first time, calculate prefix of file name */ msg = strstr(file_prefix, "gdk" DIR_SEP_STR "gdk_tracer.c"); _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org