diff options
author | Stu Grossman <grossman@cygnus> | 1993-04-09 22:14:04 +0000 |
---|---|---|
committer | Stu Grossman <grossman@cygnus> | 1993-04-09 22:14:04 +0000 |
commit | 4febd10272e10062f09c8456dacd8cfe970579d8 (patch) | |
tree | a62d659b1948b2e935868ae4eb45364eed913b66 /gdb/serial.c | |
parent | 6a42d1847267d8e1e0539a28528431617de0e70d (diff) | |
download | gdb-4febd10272e10062f09c8456dacd8cfe970579d8.zip gdb-4febd10272e10062f09c8456dacd8cfe970579d8.tar.gz gdb-4febd10272e10062f09c8456dacd8cfe970579d8.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/serial.c')
-rw-r--r-- | gdb/serial.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/serial.c b/gdb/serial.c index 5a4fcf4..e4c8cbf 100644 --- a/gdb/serial.c +++ b/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. */ |