summaryrefslogtreecommitdiff
path: root/gdb/serial.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1993-06-26 00:22:30 +0000
committerStu Grossman <grossman@cygnus>1993-06-26 00:22:30 +0000
commita037b21e7588263dba78ac0b1651abd56237ca93 (patch)
tree7c35de6074a134ee3c08e439f9b4c3d33c6124dc /gdb/serial.c
parent2685ead7d6ccad3988f6fbffbc3a96ebada3d4dc (diff)
downloadbinutils-gdb-a037b21e7588263dba78ac0b1651abd56237ca93.tar.gz
* remote.c: Add arg names to prototypes, in a modest effort at
clarification. Also add prototypes for some new functions. * (remote_wait): Better error reporting for 'T' responses. * ser-go32.c (strncasecmp): Make str1 & str2 be const. * (dos_async_init): Make usage message reflect requested port #. * ser-tcp.c (tcp_open): Terminate hostname properly to prevent random hostname lookup failures. Add nicer message for unknown host error. (wait_for): Wake up in case of exceptions. Also, restart select() if we got EINTR. * ser-unix.c (wait_for): Restart select() if we got EINTR. * serial.c: (serial_close): Clean up code.
Diffstat (limited to 'gdb/serial.c')
-rw-r--r--gdb/serial.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gdb/serial.c b/gdb/serial.c
index 005c946e9c1..6913fd6e239 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -116,11 +116,14 @@ serial_close(scb)
{
last_serial_opened = NULL;
- if (scb != NULL)
- {
- scb->ops->close(scb);
- free(scb);
- }
+/* This is bogus. It's not our fault if you pass us a bad scb...! Rob, you
+ should fix your code instead. */
+
+ if (!scb)
+ return;
+
+ scb->ops->close(scb);
+ free(scb);
}
#if 0