mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 08:38:38 +08:00
fs/driver: change unlink to nx_unlink to avoid setting errno
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
This commit is contained in:
parent
eaa34b458a
commit
a5ff391bb3
3 changed files with 7 additions and 24 deletions
|
@ -130,16 +130,8 @@ int block_proxy(FAR struct file *filep, FAR const char *blkdev, int oflags);
|
|||
* Returned Value:
|
||||
* If zero, non-zero inode pointer is returned on success. This
|
||||
* is the inode pointer of the nameless block driver that mediates
|
||||
* accesses to the mtd driver.
|
||||
*
|
||||
* Errors that may be returned:
|
||||
*
|
||||
* ENOMEM - Failed to create a temporary path name.
|
||||
*
|
||||
* Plus:
|
||||
*
|
||||
* - Errors reported from ftl_initialize()
|
||||
* - Errors reported from open() or unlink()
|
||||
* accesses to the mtd driver. A negated errno value is returned on
|
||||
* any failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
|
|
@ -186,10 +186,9 @@ int block_proxy(FAR struct file *filep, FAR const char *blkdev, int oflags)
|
|||
* a problem here!)
|
||||
*/
|
||||
|
||||
ret = unlink(chardev);
|
||||
ret = nx_unlink(chardev);
|
||||
if (ret < 0)
|
||||
{
|
||||
ret = -errno;
|
||||
ferr("ERROR: Failed to unlink %s: %d\n", chardev, ret);
|
||||
goto errout_with_chardev;
|
||||
}
|
||||
|
@ -200,7 +199,7 @@ int block_proxy(FAR struct file *filep, FAR const char *blkdev, int oflags)
|
|||
return OK;
|
||||
|
||||
errout_with_bchdev:
|
||||
unlink(chardev);
|
||||
nx_unlink(chardev);
|
||||
|
||||
errout_with_chardev:
|
||||
kmm_free(chardev);
|
||||
|
|
|
@ -131,16 +131,8 @@ static FAR char *unique_blkdev(void)
|
|||
* Returned Value:
|
||||
* If zero, non-zero inode pointer is returned on success. This
|
||||
* is the inode pointer of the nameless block driver that mediates
|
||||
* accesses to the mtd driver.
|
||||
*
|
||||
* Errors that may be returned:
|
||||
*
|
||||
* ENOMEM - Failed to create a temporary path name.
|
||||
*
|
||||
* Plus:
|
||||
*
|
||||
* - Errors reported from ftl_initialize()
|
||||
* - Errors reported from open() or unlink()
|
||||
* accesses to the mtd driver. A negated errno value is returned on
|
||||
* any failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -193,7 +185,7 @@ int mtd_proxy(FAR const char *mtddev, int mountflags,
|
|||
*/
|
||||
|
||||
out_with_fltdev:
|
||||
unlink(blkdev);
|
||||
nx_unlink(blkdev);
|
||||
out_with_blkdev:
|
||||
kmm_free(blkdev);
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue