mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
binfmt: Remove filename/exports/nexports from binary_s
to simplify the life cycle management Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Masayuki Ishikawa
parent
cf78a5b6cf
commit
bebdbc5c87
+11
-6
@@ -44,7 +44,10 @@
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int builtin_loadbinary(FAR struct binary_s *binp);
|
||||
static int builtin_loadbinary(FAR struct binary_s *binp,
|
||||
FAR const char *filename,
|
||||
FAR const struct symtab_s *exports,
|
||||
int nexports);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
@@ -69,22 +72,24 @@ static struct binfmt_s g_builtin_binfmt =
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int builtin_loadbinary(struct binary_s *binp)
|
||||
static int builtin_loadbinary(FAR struct binary_s *binp,
|
||||
FAR const char *filename,
|
||||
FAR const struct symtab_s *exports,
|
||||
int nexports)
|
||||
{
|
||||
FAR const char *filename;
|
||||
FAR const struct builtin_s *builtin;
|
||||
int fd;
|
||||
int index;
|
||||
int ret;
|
||||
|
||||
binfo("Loading file: %s\n", binp->filename);
|
||||
binfo("Loading file: %s\n", filename);
|
||||
|
||||
/* Open the binary file for reading (only) */
|
||||
|
||||
fd = nx_open(binp->filename, O_RDONLY);
|
||||
fd = nx_open(filename, O_RDONLY);
|
||||
if (fd < 0)
|
||||
{
|
||||
berr("ERROR: Failed to open binary %s: %d\n", binp->filename, fd);
|
||||
berr("ERROR: Failed to open binary %s: %d\n", filename, fd);
|
||||
return fd;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user