diff options
author | Kevin Buettner <kevinb@redhat.com> | 2003-12-08 17:00:06 +0000 |
---|---|---|
committer | Kevin Buettner <kevinb@redhat.com> | 2003-12-08 17:00:06 +0000 |
commit | 9b74d5d38586baed99d7422d48f760747a8e83cb (patch) | |
tree | 1c3f2e9b53d1d83075d4de1f2d8efef458673288 /gdb/remote.c | |
parent | 754021d045c14a02e85d9ee6e15c70ead784d083 (diff) | |
download | gdb-9b74d5d38586baed99d7422d48f760747a8e83cb.zip gdb-9b74d5d38586baed99d7422d48f760747a8e83cb.tar.gz gdb-9b74d5d38586baed99d7422d48f760747a8e83cb.tar.bz2 |
* remote.c (remote_open_1, remote_cisco_open): Avoid closing
remote_desc more than once.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index e44b932..1ed3680 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -2299,7 +2299,12 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target, { if (serial_setbaudrate (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 (remote_desc); + remote_desc = NULL; perror_with_name (name); } } @@ -5566,7 +5571,12 @@ remote_cisco_open (char *name, int from_tty) baud_rate = (baud_rate > 0) ? baud_rate : 9600; if (serial_setbaudrate (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 (remote_desc); + remote_desc = NULL; perror_with_name (name); } |