aboutsummaryrefslogtreecommitdiff
path: root/src/IO/iowatch.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/IO/iowatch.cc')
-rw-r--r--src/IO/iowatch.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/IO/iowatch.cc b/src/IO/iowatch.cc
index 0749e24c..f67b711f 100644
--- a/src/IO/iowatch.cc
+++ b/src/IO/iowatch.cc
@@ -22,7 +22,8 @@ using namespace fltk;
//
void a_IOwatch_add_fd(int fd, int when, FileHandler Callback, void *usr_data=0)
{
- add_fd(fd, when, Callback, usr_data);
+ if (fd >= 0)
+ add_fd(fd, when, Callback, usr_data);
}
//
@@ -30,6 +31,7 @@ void a_IOwatch_add_fd(int fd, int when, FileHandler Callback, void *usr_data=0)
//
void a_IOwatch_remove_fd(int fd, int when)
{
- remove_fd(fd, when);
+ if (fd >= 0)
+ remove_fd(fd, when);
}