Index: b/common/estream.c =================================================================== --- b/common/estream.c +++ b/common/estream.c @@ -270,6 +270,7 @@ /* Local prototypes. */ static void fname_set_internal (estream_t stream, const char *fname, int quote); +static int do_fflush (estream_t stream); @@ -396,6 +397,20 @@ return ret; } +/* Iterate over list of registered streams, calling ITERATOR for each + of them, but do not lock. */ +static int +es_list_iterate_unlocked (estream_iterator_t iterator) +{ + estream_list_t list_obj; + int ret = 0; + + for (list_obj = estream_list; list_obj; list_obj = list_obj->cdr) + ret |= (*iterator) (list_obj->car); + + return ret; +} + /* @@ -441,7 +456,7 @@ es_deinit (void) { /* Flush all streams. */ - es_fflush (NULL); + es_list_iterate_unlocked (do_fflush); }