Remove DMON_LOG_ERROR to return an error code

This commit is contained in:
Francesco Abbate
2022-01-09 23:26:11 +01:00
parent 7473fbf32c
commit 1520c12580
4 changed files with 64 additions and 36 deletions
+2
View File
@@ -52,6 +52,8 @@ DMON_API_IMPL bool dmon_watch_add(dmon_watch_id id, const char* watchdir)
// else, we assume that watchdir is correct, so save it as it is
struct stat st;
dmon__watch_subdir subdir;
// FIXME: check if it is a symlink and respect DMON_WATCHFLAGS_FOLLOW_SYMLINKS
// to resolve the link.
if (stat(watchdir, &st) == 0 && (st.st_mode & S_IFDIR)) {
dmon__strcpy(subdir.rootdir, sizeof(subdir.rootdir), watchdir);
if (strstr(subdir.rootdir, watch->rootdir) == subdir.rootdir) {