summaryrefslogtreecommitdiff
path: root/server/src/inotify.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/inotify.cc')
-rw-r--r--server/src/inotify.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/server/src/inotify.cc b/server/src/inotify.cc
index dba3bfd..5fb983e 100644
--- a/server/src/inotify.cc
+++ b/server/src/inotify.cc
@@ -193,6 +193,11 @@ uint32_t INotify::Event::mask()
return _mask;
}
+std::string INotify::Event::maskstr()
+{
+ return mask2asc(_mask);
+}
+
INotify::INotify()
{
ifd = inotify_init1(O_NONBLOCK);
@@ -370,6 +375,15 @@ INotify::Event INotify::getNextEvent()
return e;
}
+void INotify::clear()
+{
+ if(ifd != -1) close(ifd);
+ ifd = inotify_init1(O_NONBLOCK);
+ if(ifd == -1) {
+ perror("Inotify init failed.\n");
+ }
+}
+
#ifdef TEST_INOTIFY
//deps: debug.cc
//cflags: -I..