aboutsummaryrefslogtreecommitdiff
path: root/gdb/exceptions.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/exceptions.c')
-rw-r--r--gdb/exceptions.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/exceptions.c b/gdb/exceptions.c
index 37b8a9e..de01266 100644
--- a/gdb/exceptions.c
+++ b/gdb/exceptions.c
@@ -282,8 +282,11 @@ print_flush (void)
/* 3. The system-level buffer. */
gdb_stdout_serial = serial_fdopen (1);
- serial_drain_output (gdb_stdout_serial);
- serial_un_fdopen (gdb_stdout_serial);
+ if (gdb_stdout_serial)
+ {
+ serial_drain_output (gdb_stdout_serial);
+ serial_un_fdopen (gdb_stdout_serial);
+ }
annotate_error_begin ();
}