Merge remote-tracking branch 'lsk/v3.10/topic/configs' into linux-linaro-lsk
[firefly-linux-kernel-4.4.55.git] / tools / gator / daemon / Monitor.cpp
index 90d5c47706c73fb4e74f5a8be82d26948099ca29..b34a15f0eb0ccac547ee1162c2b429f8ca360e57 100644 (file)
@@ -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;
        }
 }