Make sure we're not querying fds that we never polled for in the first place

This commit is contained in:
Keith Winstein
2012-10-04 23:51:45 -04:00
parent b8df3eed11
commit 50e75b3127
+3
View File
@@ -37,6 +37,7 @@
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#include <sys/select.h> #include <sys/select.h>
#include <assert.h>
#include "fatal_assert.h" #include "fatal_assert.h"
#include "timestamp.h" #include "timestamp.h"
@@ -149,6 +150,7 @@ public:
const const
#endif #endif
{ {
assert( FD_ISSET( fd, &all_fds ) );
return FD_ISSET( fd, &read_fds ); return FD_ISSET( fd, &read_fds );
} }
@@ -157,6 +159,7 @@ public:
const const
#endif #endif
{ {
assert( FD_ISSET( fd, &all_fds ) );
return FD_ISSET( fd, &error_fds ); return FD_ISSET( fd, &error_fds );
} }