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:
Gregory Nutt
2018-09-15 10:49:41 -06:00
parent 17b0c9b6b0
commit a7fd58c4db
34 changed files with 375 additions and 261 deletions
+4 -4
View File
@@ -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