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/ser-go32.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/ser-go32.c')
-rw-r--r-- | gdb/ser-go32.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c index 844f861..1d930a8 100644 --- a/gdb/ser-go32.c +++ b/gdb/ser-go32.c @@ -222,7 +222,7 @@ go32_open (scb, name) if (strncasecmp (name, "com", 3) != 0) { errno = ENOENT; - return 1; + return -1; } port = name[3] - '0'; @@ -230,12 +230,12 @@ go32_open (scb, name) if ((port != 1) && (port != 2)) { errno = ENOENT; - return 1; + return -11; } scb->fd = dos_async_init(port); if (!scb->fd) - return 1; + return -1; return 0; } @@ -257,7 +257,7 @@ go32_readchar (scb, timeout) if (dosasync_read(scb->fd, &buf, 1, timeout)) return buf; else - return -2; /* Timeout, I guess */ + return SERIAL_TIMEOUT; } static int @@ -275,6 +275,8 @@ go32_write (scb, str, len) int len; { dosasync_write(scb->fd, str, len); + + return 0; } static void |