summaryrefslogtreecommitdiffstats
path: root/watch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'watch.cpp')
-rw-r--r--watch.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/watch.cpp b/watch.cpp
index a84c5ef..2ad8c4c 100644
--- a/watch.cpp
+++ b/watch.cpp
@@ -60,9 +60,12 @@ Watch::Watch(sd_event* loop, std::function<int(std::string&)> imageCallback) :
Watch::~Watch()
{
- if ((-1 != fd) && (-1 != wd))
+ if (-1 != fd)
{
- inotify_rm_watch(fd, wd);
+ if (-1 != wd)
+ {
+ inotify_rm_watch(fd, wd);
+ }
close(fd);
}
}
OpenPOWER on IntegriCloud