mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2025-02-05 00:36:22 +00:00
* ser-unix.c (wait_for): Initialize the FD_SET before every select
call. (ser_unix_wait_for): Ditto.
This commit is contained in:
parent
b045c3f9e7
commit
ab5ba170e9
@ -1,3 +1,9 @@
|
|||||||
|
Sun Dec 3 01:54:49 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
||||||
|
|
||||||
|
* ser-unix.c (wait_for): Initialize the FD_SET before every select
|
||||||
|
call.
|
||||||
|
(ser_unix_wait_for): Ditto.
|
||||||
|
|
||||||
Sun Dec 3 01:01:02 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
Sun Dec 3 01:01:02 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
||||||
|
|
||||||
* Makefile.in (varobj.o): Delete special .c.o rule supressing
|
* Makefile.in (varobj.o): Delete special .c.o rule supressing
|
||||||
|
@ -435,21 +435,22 @@ static int
|
|||||||
wait_for (serial_t scb, int timeout)
|
wait_for (serial_t scb, int timeout)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SGTTY
|
#ifdef HAVE_SGTTY
|
||||||
|
while (1)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
fd_set readfds;
|
fd_set readfds;
|
||||||
|
int numfds;
|
||||||
|
|
||||||
FD_ZERO (&readfds);
|
/* NOTE: Some OS's can scramble the READFDS when the select()
|
||||||
|
call fails (ex the kernel with Red Hat 5.2). Initialize all
|
||||||
|
arguments before each call. */
|
||||||
|
|
||||||
tv.tv_sec = timeout;
|
tv.tv_sec = timeout;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
|
|
||||||
|
FD_ZERO (&readfds);
|
||||||
FD_SET (scb->fd, &readfds);
|
FD_SET (scb->fd, &readfds);
|
||||||
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
int numfds;
|
|
||||||
|
|
||||||
if (timeout >= 0)
|
if (timeout >= 0)
|
||||||
numfds = select (scb->fd + 1, &readfds, 0, 0, &tv);
|
numfds = select (scb->fd + 1, &readfds, 0, 0, &tv);
|
||||||
else
|
else
|
||||||
@ -465,7 +466,6 @@ wait_for (serial_t scb, int timeout)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif /* HAVE_SGTTY */
|
#endif /* HAVE_SGTTY */
|
||||||
|
|
||||||
#if defined HAVE_TERMIO || defined HAVE_TERMIOS
|
#if defined HAVE_TERMIO || defined HAVE_TERMIOS
|
||||||
@ -858,21 +858,24 @@ ser_unix_nop_raw (serial_t scb)
|
|||||||
int
|
int
|
||||||
ser_unix_wait_for (serial_t scb, int timeout)
|
ser_unix_wait_for (serial_t scb, int timeout)
|
||||||
{
|
{
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
int numfds;
|
int numfds;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
fd_set readfds, exceptfds;
|
fd_set readfds, exceptfds;
|
||||||
|
|
||||||
FD_ZERO (&readfds);
|
/* NOTE: Some OS's can scramble the READFDS when the select()
|
||||||
FD_ZERO (&exceptfds);
|
call fails (ex the kernel with Red Hat 5.2). Initialize all
|
||||||
|
arguments before each call. */
|
||||||
|
|
||||||
tv.tv_sec = timeout;
|
tv.tv_sec = timeout;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
|
|
||||||
|
FD_ZERO (&readfds);
|
||||||
|
FD_ZERO (&exceptfds);
|
||||||
FD_SET (scb->fd, &readfds);
|
FD_SET (scb->fd, &readfds);
|
||||||
FD_SET (scb->fd, &exceptfds);
|
FD_SET (scb->fd, &exceptfds);
|
||||||
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
if (timeout >= 0)
|
if (timeout >= 0)
|
||||||
numfds = select (scb->fd + 1, &readfds, 0, &exceptfds, &tv);
|
numfds = select (scb->fd + 1, &readfds, 0, &exceptfds, &tv);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user