Tue Sep 28 09:45:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
[deliverable/binutils-gdb.git] / gdb / serial.c
index e5ccf1d18e1fc38ad8dc10938f3df94b1e0a921c..6913fd6e239893565bc94ebb10cdccd161021a81 100644 (file)
@@ -116,12 +116,32 @@ serial_close(scb)
 {
   last_serial_opened = NULL;
 
-  scb->ops->close(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
+/*
+The connect command is #if 0 because I hadn't thought of an elegant
+way to wait for I/O on two serial_t's simultaneously.  Two solutions
+came to mind:
+
+       1) Fork, and have have one fork handle the to user direction,
+          and have the other hand the to target direction.  This
+          obviously won't cut it for MSDOS.
+
+       2) Use something like select.  This assumes that stdin and
+          the target side can both be waited on via the same
+          mechanism.  This may not be true for DOS, if GDB is
+          talking to the target via a TCP socket.
+-grossman, 8 Jun 93
+*/
 
 /* Connect the user directly to the remote system.  This command acts just like
    the 'cu' or 'tip' command.  Use <CR>~. or <CR>~^D to break out.  */
This page took 0.027047 seconds and 4 git commands to generate.