mirror of
https://github.com/apache/nuttx.git
synced 2026-09-26 01:46:57 +08:00
libs/libc/modlib/modlib_init.c: initialize file descriptor with -1
Use -1 instead of 0 to represent an invalid descriptor so that modlib_uninitialize doesn't try to close the descriptor 0.
This commit is contained in:
committed by
Xiang Xiao
parent
bac6b11065
commit
542574acd6
@@ -132,6 +132,7 @@ int modlib_initialize(FAR const char *filename,
|
||||
/* Clear the load info structure */
|
||||
|
||||
memset(loadinfo, 0, sizeof(struct mod_loadinfo_s));
|
||||
loadinfo->filfd = -1;
|
||||
|
||||
/* Get the length of the file. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user