* fhandler.h (select_stuff): Eliminate use of 'total'.

* select.cc (cygwin_select): Ditto.
(select_stuff::wait): Use maximum size for w4 rather than calculating what will
fit.
This commit is contained in:
Christopher Faylor 2000-04-03 18:15:01 +00:00
parent 476839eb03
commit aefbf3885d
3 changed files with 11 additions and 7 deletions

View File

@ -1,3 +1,10 @@
Mon Apr 3 14:10:44 2000 Christopher Faylor <cgf@cygnus.com>
* fhandler.h (select_stuff): Eliminate use of 'total'.
* select.cc (cygwin_select): Ditto.
(select_stuff::wait): Use maximum size for w4 rather than calculating
what will fit.
Mon Apr 03 13:58:00 2000 Corinna Vinschen <corinna@vinschen.de> Mon Apr 03 13:58:00 2000 Corinna Vinschen <corinna@vinschen.de>
* grp.cc (parse_grp): Save empty array instead of * grp.cc (parse_grp): Save empty array instead of

View File

@ -793,13 +793,11 @@ class select_stuff
{ {
public: public:
~select_stuff (); ~select_stuff ();
select_stuff (): always_ready (0), windows_used (0), select_stuff (): always_ready (0), windows_used (0), start (0)
total (0), start (0)
{ {
memset (device_specific, 0, sizeof (device_specific)); memset (device_specific, 0, sizeof (device_specific));
} }
BOOL always_ready, windows_used; BOOL always_ready, windows_used;
int total;
select_record start; select_record start;
void *device_specific[FH_NDEV]; void *device_specific[FH_NDEV];

View File

@ -154,10 +154,10 @@ cygwin_select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
else else
select_printf ("to NULL, ms %x", ms); select_printf ("to NULL, ms %x", ms);
select_printf ("sel.total %d, sel.always_ready %d", sel.total, sel.always_ready); select_printf ("sel.always_ready %d", sel.always_ready);
/* Degenerate case. No fds to wait for. Just wait. */ /* Degenerate case. No fds to wait for. Just wait. */
if (sel.total == 0) if (sel.start.next == NULL)
{ {
if (WaitForSingleObject (signal_arrived, ms) == WAIT_OBJECT_0) if (WaitForSingleObject (signal_arrived, ms) == WAIT_OBJECT_0)
{ {
@ -225,7 +225,6 @@ select_stuff::test_and_set (int i, fd_set *readfds, fd_set *writefds,
s->next = start.next; s->next = start.next;
start.next = s; start.next = s;
total++;
return 1; return 1;
} }
@ -247,7 +246,7 @@ select_stuff::wait (fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
DWORD ms) DWORD ms)
{ {
int wait_ret; int wait_ret;
HANDLE w4[total + 1]; HANDLE w4[MAXIMUM_WAIT_OBJECTS];
select_record *s = &start; select_record *s = &start;
int m = 0; int m = 0;