Fix errors with previous commit

This commit is contained in:
Francesco Abbate 2021-09-21 16:41:09 +02:00
parent 794fd6b47b
commit 941f135047
2 changed files with 7 additions and 7 deletions

View File

@ -187,12 +187,12 @@ local function scan_project_folder(index)
print("DEBUG setting files limit FLAG for", dir.name) print("DEBUG setting files limit FLAG for", dir.name)
dir.files_limit = true dir.files_limit = true
-- Watch non-recursively -- Watch non-recursively
dir.watch_id = system.watch_dir(path, false) dir.watch_id = system.watch_dir(dir.name, false)
if core.status_view then -- May be not yet initialized. if core.status_view then -- May be not yet initialized.
show_max_files_warning() show_max_files_warning()
end end
else else
dir.watch_id = system.watch_dir(path, true) dir.watch_id = system.watch_dir(dir.name, true)
end end
dir.files = t dir.files = t
core.dir_rescan_add_job(dir, ".") core.dir_rescan_add_job(dir, ".")

View File

@ -840,13 +840,13 @@ DMON_API_IMPL bool dmon_watch_rm(dmon_watch_id id, const char* watchdir)
pthread_mutex_unlock(&_dmon.mutex); pthread_mutex_unlock(&_dmon.mutex);
return false; return false;
} }
inotify_rm_watch(fd, watch->wds[i]); inotify_rm_watch(watch->fd, watch->wds[i]);
for (int j = i; j < c - 1; j++) { for (int j = i; j < c - 1; j++) {
memcpy(watch->subdir + j, watch->subdir + j + 1, sizeof(dmon__watch_subdir)); memcpy(watch->subdirs + j, watch->subdirs + j + 1, sizeof(dmon__watch_subdir));
memcpy(watch->wds + j, watch->wds + j + 1, sizeof(int)); memcpy(watch->wds + j, watch->wds + j + 1, sizeof(int));
} }
stb__sbraw(watch->subdir)[1] = c - 1; stb__sbraw(watch->subdirs)[1] = c - 1;
stb__sbraw(watch->wds)[1] = c - 1; stb__sbraw(watch->wds)[1] = c - 1;
pthread_mutex_unlock(&_dmon.mutex); pthread_mutex_unlock(&_dmon.mutex);