Use the same pointer from FileWatch to refer to the entry in a parent FileWatch
This commit is contained in:
@@ -140,7 +140,7 @@ HiResult file_watch_add(FileWatcherContext *ctx, u32 mask,
|
||||
int wd = inotify_add_watch(ctx->fd, parent_name, params.parent_mask);
|
||||
FileWatch wp = {.wd = wd, .mask = HI_FILE_PARENT, .path = parent_name};
|
||||
sc_array_init(&wp.files);
|
||||
sc_array_add(&wp.files, strdup(watch->path));
|
||||
sc_array_add(&wp.files, watch->path);
|
||||
sc_array_add(&ctx->watches, wp);
|
||||
} else {
|
||||
free(parent_name);
|
||||
|
||||
Reference in New Issue
Block a user