serial_timedreadchar() to new serial_readchar().
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)
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)
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);
while (1)
{
- serial_timedreadchar(timeout, &ok);
- if (!ok) break;
+ ok = serial_readchar(timeout);
+ if (ok < 0) break;
}
hms_write("r",1);
}
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
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. */