aboutsummaryrefslogtreecommitdiff
path: root/gdb/event-top.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/event-top.c')
-rw-r--r--gdb/event-top.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gdb/event-top.c b/gdb/event-top.c
index c533e74..968117c 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -980,11 +980,6 @@ handle_fatal_signal (int sig)
#endif
#ifdef GDB_PRINT_INTERNAL_BACKTRACE
- const auto sig_write = [] (const char *msg) -> void
- {
- gdb_stderr->write_async_safe (msg, strlen (msg));
- };
-
if (bt_on_fatal_signal)
{
sig_write ("\n\n");
@@ -1027,7 +1022,13 @@ handle_fatal_signal (int sig)
}
sig_write ("\n\n");
- gdb_stderr->flush ();
+ if (gdb_stderr == nullptr || gdb_stderr->fd () == -1)
+ {
+ /* Writing to file descriptor instead of stream, no flush
+ required. */
+ }
+ else
+ gdb_stderr->flush ();
}
#endif