From 2e3b31d565c65ec43b398c02635bcec085e23808 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Wed, 14 Oct 2026 11:10:29 +0900 Subject: estream: Skip the read-only stream when IN_ATEXIT is true. * src/estream.c (_gpgrt_fflush): Skip the read-only stream. -- GnuPG-bug-id: 8518 Signed-off-by: NIIBE Yutaka --- src/estream.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/estream.c b/src/estream.c index 301a078..24e82d8 100644 --- a/src/estream.c +++ b/src/estream.c @@ -4578,9 +4578,12 @@ _gpgrt_fflush (estream_t stream, int in_atexit) for (item = estream_list; item; item = item->next) if (item->stream) { + if (in_atexit && !item->stream->flags.writing) + /* Skip read-only stream */ + continue; + /* The code below does not work - we need to think more about * atexit handlers and stream locking. */ - (void)in_atexit; /* if (in_atexit) */ /* { */ /* /\* Do not flush if we can't take the lock while we are */ -- cgit