fs/shm: use ERROR instead of -1

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko 2023-01-26 01:35:30 +02:00 committed by Xiang Xiao
parent e5dbc3328c
commit d35d8b4a12
2 changed files with 5 additions and 4 deletions

View File

@ -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;

View File

@ -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;
} }