aboutsummaryrefslogtreecommitdiff
path: root/gdb/serial.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-08-29 07:20:22 -0600
committerTom Tromey <tromey@adacore.com>2023-11-27 12:55:14 -0700
commitad3cf8c64e6e4794fc48d28c90f20cbbfdc51ca4 (patch)
tree8c8c2b1ff861a6a9a2812522fb95ec9e7feec779 /gdb/serial.c
parent602971b3863dcecf2daa5ffc0853a75a3131446c (diff)
downloadgdb-ad3cf8c64e6e4794fc48d28c90f20cbbfdc51ca4.zip
gdb-ad3cf8c64e6e4794fc48d28c90f20cbbfdc51ca4.tar.gz
gdb-ad3cf8c64e6e4794fc48d28c90f20cbbfdc51ca4.tar.bz2
Change serial_setbaudrate to throw exception
remote.c has this code: if (serial_setbaudrate (rs->remote_desc, baud_rate)) { /* The requested speed could not be set. Error out to top level after closing remote_desc. Take care to set remote_desc to NULL to avoid closing remote_desc more than once. */ serial_close (rs->remote_desc); rs->remote_desc = NULL; perror_with_name (name); The perror here cannot be correct, because if serial_setbaudrate did set errno, it may be obscured by serial_close. This patch changes serial_setbaudrate to throw an exception instead. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30770
Diffstat (limited to 'gdb/serial.c')
-rw-r--r--gdb/serial.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/serial.c b/gdb/serial.c
index 8a8bab4..122ab0b 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -512,10 +512,10 @@ serial_print_tty_state (struct serial *scb,
scb->ops->print_tty_state (scb, ttystate, stream);
}
-int
+void
serial_setbaudrate (struct serial *scb, int rate)
{
- return scb->ops->setbaudrate (scb, rate);
+ scb->ops->setbaudrate (scb, rate);
}
int