* remote-hms.c, ser-go32.c, serial.h: Change from
serial_timedreadchar() to new serial_readchar().
This commit is contained in:
parent
d95eb93075
commit
5a6242dddd
4 changed files with 14 additions and 19 deletions
|
@ -1,5 +1,8 @@
|
||||||
Mon Oct 19 15:09:57 1992 Stu Grossman (grossman at cygnus.com)
|
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.
|
* Makefile.in (HFILES): Fixup list of nm-*.h files. Add missing ones.
|
||||||
|
|
||||||
Mon Oct 19 12:45:23 1992 Per Bothner (bothner@cygnus.com)
|
Mon Oct 19 12:45:23 1992 Per Bothner (bothner@cygnus.com)
|
||||||
|
|
|
@ -251,11 +251,10 @@ int check_open()
|
||||||
static int
|
static int
|
||||||
readchar ()
|
readchar ()
|
||||||
{
|
{
|
||||||
int ok;
|
|
||||||
int buf;
|
int buf;
|
||||||
buf = serial_timedreadchar(timeout, &ok);
|
buf = serial_readchar(timeout);
|
||||||
|
|
||||||
if (!ok)
|
if (buf < 0)
|
||||||
error ("Timeout reading from remote system.");
|
error ("Timeout reading from remote system.");
|
||||||
|
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
|
@ -267,10 +266,9 @@ readchar ()
|
||||||
static int
|
static int
|
||||||
readchar_nofail ()
|
readchar_nofail ()
|
||||||
{
|
{
|
||||||
int ok;
|
|
||||||
int buf;
|
int buf;
|
||||||
buf = serial_timedreadchar(timeout, &ok);
|
buf = serial_readchar(timeout);
|
||||||
if (!ok) buf = 0;
|
if (buf < 0) buf = 0;
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
printf("%c",buf);
|
printf("%c",buf);
|
||||||
|
|
||||||
|
@ -544,8 +542,8 @@ is_baudrate_right()
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
serial_timedreadchar(timeout, &ok);
|
ok = serial_readchar(timeout);
|
||||||
if (!ok) break;
|
if (ok < 0) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
hms_write("r",1);
|
hms_write("r",1);
|
||||||
|
|
|
@ -294,20 +294,14 @@ serial_open (name)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
serial_timedreadchar (to, ok)
|
serial_readchar (to)
|
||||||
int to;
|
int to;
|
||||||
int *ok;
|
|
||||||
{
|
{
|
||||||
char buf;
|
char buf;
|
||||||
if (dosasync_read(fd, &buf, 1, to))
|
if (dosasync_read(fd, &buf, 1, to))
|
||||||
{
|
|
||||||
*ok = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
*ok = 0;
|
|
||||||
}
|
|
||||||
return buf;
|
return buf;
|
||||||
|
else
|
||||||
|
return -2; /* Timeout, I guess */
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -56,9 +56,9 @@ void serial_raw PARAMS ((int fd, struct ttystate *oldstate));
|
||||||
void serial_normal PARAMS ((void));
|
void serial_normal PARAMS ((void));
|
||||||
|
|
||||||
/* Read one char from the serial device with <TO>-second timeout.
|
/* 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
|
/* Set the baudrate to the decimal value supplied, and return 1, or fail and
|
||||||
return 0. */
|
return 0. */
|
||||||
|
|
Loading…
Add table
Reference in a new issue