forked from Imagelibrary/binutils-gdb
* remote.c (remote_open): Use SERIAL_OPEN instead of serial_open.
(putpkt, getpkt): Use new return codes for SERIAL_READCHAR. * ser-go32.c: Return -1 on most failures, 0 on most successes, and use new return codes for go32_readchar(). * ser-unix.c: Ditto. Also, move error handling up to caller for SERIAL_SETBAUDRATE(). * serial.c (serial_open): Internal call, not SERIAL_OPEN to get to specific routine. (serial_close): New routine to wrap around device close routine. serial.h: Clean & document return values more clearly.
This commit is contained in:
11
gdb/serial.c
11
gdb/serial.c
@@ -64,7 +64,7 @@ serial_open(name)
|
||||
scb->bufcnt = 0;
|
||||
scb->bufp = scb->buf;
|
||||
|
||||
if (SERIAL_OPEN (scb, name))
|
||||
if (scb->ops->open(scb, name))
|
||||
{
|
||||
free (scb);
|
||||
return NULL;
|
||||
@@ -73,6 +73,15 @@ serial_open(name)
|
||||
return scb;
|
||||
}
|
||||
|
||||
void
|
||||
serial_close(scb)
|
||||
serial_t scb;
|
||||
{
|
||||
scb->ops->close(scb);
|
||||
|
||||
free(scb);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* 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. */
|
||||
|
||||
Reference in New Issue
Block a user