mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 06:42:32 +08:00
Squashed commit of the following:
many locations: Change occurences of open() followed by file_detach() to file_open(). Change most non-controversion calls to open() to nx_open().
fs/inode/fs_fileopen.c: Flesh out file_open() with some interim, placeholder logic.
fs/inode/fs_fileopen.c: Add a framework for a file_open() implementation (no real logic in place yet).
fs/vfs/fs_open.c: Add nx_open() which is the same as open() except that it does not create a cancellation point nor does it modify the errno variable.
This commit is contained in:
+4
-4
@@ -48,6 +48,7 @@
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/fs/ioctl.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
#include <nuttx/binfmt/builtin.h>
|
||||
@@ -99,12 +100,11 @@ static int builtin_loadbinary(struct binary_s *binp)
|
||||
|
||||
/* Open the binary file for reading (only) */
|
||||
|
||||
fd = open(binp->filename, O_RDONLY);
|
||||
fd = nx_open(binp->filename, O_RDONLY);
|
||||
if (fd < 0)
|
||||
{
|
||||
int errval = get_errno();
|
||||
berr("ERROR: Failed to open binary %s: %d\n", binp->filename, errval);
|
||||
return -errval;
|
||||
berr("ERROR: Failed to open binary %s: %d\n", binp->filename, fd);
|
||||
return fd;
|
||||
}
|
||||
|
||||
/* If this file is a BINFS file system, then we can recover the name of
|
||||
|
||||
Reference in New Issue
Block a user