diff options
| author | Werner Koch <[email protected]> | 2026-05-03 15:22:46 +0200 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2026-05-03 15:22:46 +0200 |
| commit | ff90817a95208c407c6e5a74eeb585db3b5baff9 (patch) | |
| tree | db203e815ec88399e6843ecd073a9a9d4ad9eebc /src | |
| parent | Fix possible lockup in an atexit handler (diff) | |
| download | libgpg-error-ff90817a95208c407c6e5a74eeb585db3b5baff9.tar.gz libgpg-error-ff90817a95208c407c6e5a74eeb585db3b5baff9.zip | |
Revert "Fix possible lockup in an atexit handler"
* src/estream.c (_gpgrt_fflush): Do not use the in_atexit flag.
--
We need to research how we can better handle atexit handlers and
stream locking; in particilar for stdout and stderr. For now we keep
the code but disable it.
Fixes-commit: 50f0c56bdd36f7f709a62503942ac55399dafb9c
Diffstat (limited to 'src')
| -rw-r--r-- | src/estream.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/estream.c b/src/estream.c index 55709f8..d2cdc12 100644 --- a/src/estream.c +++ b/src/estream.c @@ -4573,18 +4573,21 @@ _gpgrt_fflush (estream_t stream, int in_atexit) for (item = estream_list; item; item = item->next) if (item->stream) { - if (in_atexit) - { - /* Do not flush if we can't take the lock while we are - * in an atexit handler. The atexit handler might - * have been called while the stream was locked. */ - if (!trylock_stream (item->stream)) - { - err |= do_fflush (item->stream); - unlock_stream (item->stream); - } - } - else + /* 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 */ + /* * in an atexit handler. The atexit handler might */ + /* * have been called while the stream was locked. *\/ */ + /* if (!trylock_stream (item->stream)) */ + /* { */ + /* err |= do_fflush (item->stream); */ + /* unlock_stream (item->stream); */ + /* } */ + /* } */ + /* else */ { lock_stream (item->stream); err |= do_fflush (item->stream); |
