aboutsummaryrefslogtreecommitdiff
path: root/gdb/mingw-hdep.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-06-10 18:24:32 +0000
committerDaniel Jacobowitz <drow@false.org>2006-06-10 18:24:32 +0000
commit98739726e2765867341ca3cae4631b22c8cf8143 (patch)
tree41c2bb4e8cc8e4c8c99aabfa92b0e331b019391d /gdb/mingw-hdep.c
parentb3882df925df241bb074fcf65e6964a15492b88c (diff)
downloadgdb-98739726e2765867341ca3cae4631b22c8cf8143.zip
gdb-98739726e2765867341ca3cae4631b22c8cf8143.tar.gz
gdb-98739726e2765867341ca3cae4631b22c8cf8143.tar.bz2
* mingw-hdep.c (gdb_select): Always check for NULL fd sets
before calling FD_ISSET. Correct check for exceptfds which previously tested writefds.
Diffstat (limited to 'gdb/mingw-hdep.c')
-rw-r--r--gdb/mingw-hdep.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gdb/mingw-hdep.c b/gdb/mingw-hdep.c
index bb0f50a..2b92a1c 100644
--- a/gdb/mingw-hdep.c
+++ b/gdb/mingw-hdep.c
@@ -105,8 +105,8 @@ gdb_select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
if something starts using it. */
gdb_assert (!writefds || !FD_ISSET (fd, writefds));
- if (!FD_ISSET (fd, readfds)
- && !FD_ISSET (fd, exceptfds))
+ if ((!readfds || !FD_ISSET (fd, readfds))
+ && (!exceptfds || !FD_ISSET (fd, exceptfds)))
continue;
h = (HANDLE) _get_osfhandle (fd);
@@ -124,13 +124,13 @@ gdb_select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
except = never_handle;
}
- if (FD_ISSET (fd, readfds))
+ if (readfds && FD_ISSET (fd, readfds))
{
gdb_assert (num_handles < MAXIMUM_WAIT_OBJECTS);
handles[num_handles++] = read;
}
- if (FD_ISSET (fd, exceptfds))
+ if (exceptfds && FD_ISSET (fd, exceptfds))
{
gdb_assert (num_handles < MAXIMUM_WAIT_OBJECTS);
handles[num_handles++] = except;
@@ -169,10 +169,11 @@ gdb_select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
HANDLE fd_h;
struct serial *scb;
- if (!FD_ISSET (fd, readfds) && !FD_ISSET (fd, writefds))
+ if ((!readfds || !FD_ISSET (fd, readfds))
+ && (!exceptfds || !FD_ISSET (fd, exceptfds)))
continue;
- if (FD_ISSET (fd, readfds))
+ if (readfds && FD_ISSET (fd, readfds))
{
fd_h = handles[indx++];
/* This handle might be ready, even though it wasn't the handle
@@ -183,7 +184,7 @@ gdb_select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
num_ready++;
}
- if (FD_ISSET (fd, exceptfds))
+ if (exceptfds && FD_ISSET (fd, exceptfds))
{
fd_h = handles[indx++];
/* This handle might be ready, even though it wasn't the handle