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
+3 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* drivers/serial/ptmx.c
*
* Copyright (C) 2016-2017 Gregory Nutt. All rights reserved.
* Copyright (C) 2016-2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -248,8 +248,8 @@ static int ptmx_open(FAR struct file *filep)
/* Open the master device: /dev/ptyN, where N=minor */
snprintf(devname, 16, "/dev/pty%d", minor);
fd = open(devname, O_RDWR);
DEBUGASSERT(fd >= 0); /* open() should never fail */
fd = nx_open(devname, O_RDWR);
DEBUGASSERT(fd >= 0); /* nx_open() should never fail */
/* No unlink the master. This will remove it from the VFS namespace,
* the driver will still persist because of the open count on the