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:
YAMAMOTO Takashi 2021-02-25 13:54:44 +09:00 committed by Xiang Xiao
parent bac6b11065
commit 542574acd6
1 changed files with 1 additions and 0 deletions

View File

@ -132,6 +132,7 @@ int modlib_initialize(FAR const char *filename,
/* Clear the load info structure */ /* Clear the load info structure */
memset(loadinfo, 0, sizeof(struct mod_loadinfo_s)); memset(loadinfo, 0, sizeof(struct mod_loadinfo_s));
loadinfo->filfd = -1;
/* Get the length of the file. */ /* Get the length of the file. */