Browse files

Make sure we're not querying fds that we never polled for in the firs…

…t place
  • Loading branch information...
1 parent b8df3ee commit 50e75b3127a23b6e3c49167aab88d4a3012649c4 @keithw keithw committed Oct 5, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/util/select.h
View
3 src/util/select.h
@@ -37,6 +37,7 @@
#include <errno.h>
#include <signal.h>
#include <sys/select.h>
+#include <assert.h>
#include "fatal_assert.h"
#include "timestamp.h"
@@ -149,6 +150,7 @@ class Select {
const
#endif
{
+ assert( FD_ISSET( fd, &all_fds ) );
return FD_ISSET( fd, &read_fds );
}
@@ -157,6 +159,7 @@ class Select {
const
#endif
{
+ assert( FD_ISSET( fd, &all_fds ) );
return FD_ISSET( fd, &error_fds );
}

0 comments on commit 50e75b3

Please sign in to comment.