Revert 'Remove unused struct serial::name field'
[deliverable/binutils-gdb.git] / gdb / serial.c
index 804ef1826764b2344c5e8b58809090331d90abaa..a1c3b91c7c2fb89c7ee8765a0d77c316875e5408 100644 (file)
@@ -247,6 +247,7 @@ serial_open_ops_1 (const struct serial_ops *ops, const char *open_name)
       return NULL;
     }
 
+  scb->name = open_name != NULL ? xstrdup (open_name) : NULL;
   scb->next = scb_base;
   scb_base = scb;
 
@@ -291,6 +292,7 @@ serial_fdopen_ops (const int fd, const struct serial_ops *ops)
 
   scb = new_serial (ops);
 
+  scb->name = NULL;
   scb->next = scb_base;
   scb_base = scb;
 
@@ -330,6 +332,8 @@ do_serial_close (struct serial *scb, int really_close)
   if (really_close)
     scb->ops->close (scb);
 
+  xfree (scb->name);
+
   /* For serial_is_open.  */
   scb->bufp = NULL;
 
This page took 0.023257 seconds and 4 git commands to generate.