diff options
Diffstat (limited to 'tools/gator/daemon/Monitor.cpp')
-rw-r--r-- | tools/gator/daemon/Monitor.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/gator/daemon/Monitor.cpp b/tools/gator/daemon/Monitor.cpp index 90d5c47706c7..b34a15f0eb0c 100644 --- a/tools/gator/daemon/Monitor.cpp +++ b/tools/gator/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; } } |