summaryrefslogtreecommitdiff
path: root/src/util/file
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-08-12 17:38:09 -0400
committerAndrew Opalach <andrew@akon.city> 2025-08-12 17:38:09 -0400
commitab75884371a3545f7548498549e2faebbc465ed6 (patch)
tree0a4b99a55b186eda26bf63343db91c931fb88279 /src/util/file
parenteaf84a7850f2af70b16fb417cd002f5e39df5db2 (diff)
downloadlibnaunet-ab75884371a3545f7548498549e2faebbc465ed6.tar.gz
libnaunet-ab75884371a3545f7548498549e2faebbc465ed6.tar.bz2
libnaunet-ab75884371a3545f7548498549e2faebbc465ed6.zip
Improve inotify usage, copy path in file_stdio
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/util/file')
-rw-r--r--src/util/file/file_stdio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/util/file/file_stdio.c b/src/util/file/file_stdio.c
index 97dd0f0..fa74be7 100644
--- a/src/util/file/file_stdio.c
+++ b/src/util/file/file_stdio.c
@@ -49,6 +49,8 @@ bool nn_file_open(struct nn_file *file, str *path, s32 flags)
return false;
}
+ al_str_clone(&file->path, path);
+
return true;
}
@@ -112,6 +114,7 @@ void *nn_file_mmap(struct nn_file *file)
void nn_file_close(struct nn_file *file)
{
fclose(file->file);
+ al_str_free(&file->path);
}
bool nn_dir_open(struct nn_dir *dir, str *path) { (void)dir; (void)path; return false; }