fs/shm: use ERROR instead of -1
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
parent
e5dbc3328c
commit
d35d8b4a12
@ -23,6 +23,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -165,7 +166,7 @@ int shm_open(FAR const char *name, int oflag, mode_t mode)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
set_errno(-ret);
|
set_errno(-ret);
|
||||||
return -1;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = file_allocate(shm.f_inode, shm.f_oflags, shm.f_pos, shm.f_priv, 0,
|
ret = file_allocate(shm.f_inode, shm.f_oflags, shm.f_pos, shm.f_priv, 0,
|
||||||
@ -174,7 +175,7 @@ int shm_open(FAR const char *name, int oflag, mode_t mode)
|
|||||||
{
|
{
|
||||||
set_errno(-ret);
|
set_errno(-ret);
|
||||||
file_close(&shm);
|
file_close(&shm);
|
||||||
return -1;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -155,8 +155,8 @@ int shm_unlink(FAR const char *name)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
set_errno(-ret);
|
set_errno(-ret);
|
||||||
return -1;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user