mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user