GNU Binutils with patches for OS216
Révision | a9205f4fc3d1611bf1aa29dcebe1395c627ae98c (tree) |
---|---|
l'heure | 2020-01-10 23:53:36 |
Auteur | Pedro Alves <palves@redh...> |
Commiter | Pedro Alves |
Revert 'Remove unused struct serial::name field'
This commit reverts:
The following patches will add uses for the field.
gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>
Revert:
2016-04-12 Pedro Alves <palves@redhat.com>
* serial.c (serial_open, serial_fdopen_ops, do_serial_close):
Remove references to name.
* serial.h (struct serial) <name>: Delete.
@@ -247,6 +247,7 @@ serial_open_ops_1 (const struct serial_ops *ops, const char *open_name) | ||
247 | 247 | return NULL; |
248 | 248 | } |
249 | 249 | |
250 | + scb->name = open_name != NULL ? xstrdup (open_name) : NULL; | |
250 | 251 | scb->next = scb_base; |
251 | 252 | scb_base = scb; |
252 | 253 |
@@ -291,6 +292,7 @@ serial_fdopen_ops (const int fd, const struct serial_ops *ops) | ||
291 | 292 | |
292 | 293 | scb = new_serial (ops); |
293 | 294 | |
295 | + scb->name = NULL; | |
294 | 296 | scb->next = scb_base; |
295 | 297 | scb_base = scb; |
296 | 298 |
@@ -330,6 +332,8 @@ do_serial_close (struct serial *scb, int really_close) | ||
330 | 332 | if (really_close) |
331 | 333 | scb->ops->close (scb); |
332 | 334 | |
335 | + xfree (scb->name); | |
336 | + | |
333 | 337 | /* For serial_is_open. */ |
334 | 338 | scb->bufp = NULL; |
335 | 339 |
@@ -240,6 +240,7 @@ struct serial | ||
240 | 240 | buffer. -ve for sticky errors. */ |
241 | 241 | unsigned char *bufp; /* Current byte */ |
242 | 242 | unsigned char buf[BUFSIZ]; /* Da buffer itself */ |
243 | + char *name; /* The name of the device or host */ | |
243 | 244 | struct serial *next; /* Pointer to the next `struct serial *' */ |
244 | 245 | int debug_p; /* Trace this serial devices operation. */ |
245 | 246 | int async_state; /* Async internal state. */ |