* remote-hms.c, ser-go32.c, serial.h: Change from

serial_timedreadchar() to new serial_readchar().
This commit is contained in:
Stu Grossman 1992-10-19 23:40:36 +00:00
parent d95eb93075
commit 5a6242dddd
4 changed files with 14 additions and 19 deletions

View File

@ -1,5 +1,8 @@
Mon Oct 19 15:09:57 1992 Stu Grossman (grossman at cygnus.com)
* remote-hms.c, ser-go32.c, serial.h: Change from
serial_timedreadchar() to new serial_readchar().
* Makefile.in (HFILES): Fixup list of nm-*.h files. Add missing ones.
Mon Oct 19 12:45:23 1992 Per Bothner (bothner@cygnus.com)

View File

@ -251,11 +251,10 @@ int check_open()
static int
readchar ()
{
int ok;
int buf;
buf = serial_timedreadchar(timeout, &ok);
buf = serial_readchar(timeout);
if (!ok)
if (buf < 0)
error ("Timeout reading from remote system.");
if (!quiet)
@ -267,10 +266,9 @@ readchar ()
static int
readchar_nofail ()
{
int ok;
int buf;
buf = serial_timedreadchar(timeout, &ok);
if (!ok) buf = 0;
buf = serial_readchar(timeout);
if (buf < 0) buf = 0;
if (!quiet)
printf("%c",buf);
@ -544,8 +542,8 @@ is_baudrate_right()
while (1)
{
serial_timedreadchar(timeout, &ok);
if (!ok) break;
ok = serial_readchar(timeout);
if (ok < 0) break;
}
hms_write("r",1);

View File

@ -294,20 +294,14 @@ serial_open (name)
}
int
serial_timedreadchar (to, ok)
serial_readchar (to)
int to;
int *ok;
{
char buf;
if (dosasync_read(fd, &buf, 1, to))
{
*ok = 1;
}
return buf;
else
{
*ok = 0;
}
return buf;
return -2; /* Timeout, I guess */
}
int

View File

@ -56,9 +56,9 @@ void serial_raw PARAMS ((int fd, struct ttystate *oldstate));
void serial_normal PARAMS ((void));
/* Read one char from the serial device with <TO>-second timeout.
Return char, and set ok if ok. */
Returns char if ok, else EOF, -2 for timeout, -3 for anything else */
int serial_timedreadchar PARAMS ((int to, int *ok));
int serial_readchar PARAMS ((int to));
/* Set the baudrate to the decimal value supplied, and return 1, or fail and
return 0. */