aboutsummaryrefslogtreecommitdiff
path: root/daemon/Monitor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/Monitor.cpp')
-rw-r--r--daemon/Monitor.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/daemon/Monitor.cpp b/daemon/Monitor.cpp
index 90d5c47..b34a15f 100644
--- a/daemon/Monitor.cpp
+++ b/daemon/Monitor.cpp
@@ -18,8 +18,15 @@ Monitor::Monitor() : mFd(-1) {
}
Monitor::~Monitor() {
- if (mFd >= -1) {
- close(mFd);
+ if (mFd >= 0) {
+ ::close(mFd);
+ }
+}
+
+void Monitor::close() {
+ if (mFd >= 0) {
+ ::close(mFd);
+ mFd = -1;
}
}