summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2010-04-05 19:11:49 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2010-04-05 19:11:49 +0000
commit4a086a380994f17b266cfb190f913e5a83d4dd0c (patch)
tree3fb92e3ccad962cd5f4d43e139aa13c2470fb06a /src
parent769ebeeba74fd793c4a3cb915be34598e0dfbef1 (diff)
Fixed max. fd calculation, if USE_POLL is enabled (STR #2324).
This could maybe be removed completely, but anyway... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7431 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_x.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index c66f71455..aa046d757 100644
--- a/src/Fl_x.cxx
+++ b/src/Fl_x.cxx
@@ -136,7 +136,9 @@ void Fl::add_fd(int n, void (*cb)(int, void*), void* v) {
void Fl::remove_fd(int n, int events) {
int i,j;
+# if !USE_POLL
maxfd = -1; // recalculate maxfd on the fly
+# endif
for (i=j=0; i<nfds; i++) {
# if USE_POLL
if (pollfds[i].fd == n) {
@@ -150,8 +152,8 @@ void Fl::remove_fd(int n, int events) {
if (!e) continue; // if no events left, delete this fd
fd[i].events = e;
}
-# endif
if (fd[i].fd > maxfd) maxfd = fd[i].fd;
+# endif
// move it down in the array if necessary:
if (j<i) {
fd[j] = fd[i];