Revert call to bfd_cache_close().
[deliverable/binutils-gdb.git] / gdb / serial.c
index d78fb40c1120a9a797d2407cd2ce91ccd8d84dcc..1719f7d6c88789366779431c1a8b71ca624a08d9 100644 (file)
@@ -1,5 +1,7 @@
 /* Generic serial interface routines
-   Copyright 1992, 1993, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+
+   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -209,11 +211,11 @@ serial_open (const char *name)
 
   if (scb->ops->open (scb, open_name))
     {
-      free (scb);
+      xfree (scb);
       return NULL;
     }
 
-  scb->name = strsave (name);
+  scb->name = xstrdup (name);
   scb->next = scb_base;
   scb->refcnt = 1;
   scb->debug_p = 0;
@@ -310,7 +312,7 @@ do_serial_close (serial_t scb, int really_close)
     scb->ops->close (scb);
 
   if (scb->name)
-    free (scb->name);
+    xfree (scb->name);
 
   if (scb_base == scb)
     scb_base = scb_base->next;
@@ -324,7 +326,7 @@ do_serial_close (serial_t scb, int really_close)
        break;
       }
 
-  free (scb);
+  xfree (scb);
 }
 
 void
@@ -347,7 +349,8 @@ serial_readchar (serial_t scb, int timeout)
   /* FIXME: cagney/1999-10-11: Don't enable this check until the ASYNC
      code is finished. */
   if (0 && SERIAL_IS_ASYNC_P (scb) && timeout < 0)
-    internal_error ("serial_readchar: blocking read in async mode");
+    internal_error (__FILE__, __LINE__,
+                   "serial_readchar: blocking read in async mode");
 
   ch = scb->ops->readchar (scb, timeout);
   if (serial_logfp != NULL)
@@ -394,10 +397,10 @@ serial_printf (serial_t desc, const char *format,...)
   char *buf;
   va_start (args, format);
 
-  vasprintf (&buf, format, args);
+  xvasprintf (&buf, format, args);
   SERIAL_WRITE (desc, buf, strlen (buf));
 
-  free (buf);
+  xfree (buf);
   va_end (args);
 }
 
@@ -506,7 +509,8 @@ deprecated_serial_fd (serial_t scb)
      called? */
   if (scb->fd < 0)
     {
-      internal_error ("serial: FD not valid");
+      internal_error (__FILE__, __LINE__,
+                     "serial: FD not valid");
     }
   return scb->fd; /* sigh */
 }
@@ -551,7 +555,7 @@ cleanup_tty (serial_ttystate ttystate)
 {
   printf_unfiltered ("\r\n[Exiting connect mode]\r\n");
   SERIAL_SET_TTY_STATE (tty_desc, ttystate);
-  free (ttystate);
+  xfree (ttystate);
   SERIAL_CLOSE (tty_desc);
 }
 
This page took 0.023631 seconds and 4 git commands to generate.