MCPcopy Create free account
hub / github.com/Axosoft/nsfw / InotifyService

Method InotifyService

src/linux/InotifyService.cpp:3–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "../../includes/linux/InotifyService.h"
2
3InotifyService::InotifyService(std::shared_ptr<EventQueue> queue, std::string path, const std::vector<std::string> &excludedPaths):
4 mEventLoop(NULL),
5 mQueue(queue),
6 mTree(NULL) {
7 mInotifyInstance = inotify_init();
8
9 if (mInotifyInstance == -1) {
10 return;
11 }
12
13 mTree = new InotifyTree(mInotifyInstance, path, excludedPaths);
14 if (!mTree->isRootAlive()) {
15 delete mTree;
16 mTree = NULL;
17 mEventLoop = NULL;
18 close(mInotifyInstance);
19 } else {
20 mEventLoop = new InotifyEventLoop(
21 mInotifyInstance,
22 this
23 );
24 }
25}
26
27InotifyService::~InotifyService() {
28 if (mEventLoop != NULL) {

Callers

nothing calls this directly

Calls 1

isRootAliveMethod · 0.80

Tested by

no test coverage detected