mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 05:16:47 +08:00
sys/type.h: Change pid_t from int16_t to int
to fix the following warning:
include/unistd.h:302:9: error: incompatible redeclaration of library function 'vfork' [-Werror,-Wincompatible-library-redeclaration]
pid_t vfork(void);
^
include/unistd.h:302:9: note: 'vfork' is a builtin with type 'int (void)'
and change 32768 to INT_MAX to match the type change
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
85550ee340
commit
0f2f48f8ba
@@ -1445,11 +1445,11 @@ static int proc_open(FAR struct file *filep, FAR const char *relpath,
|
||||
|
||||
ptr++;
|
||||
|
||||
/* A valid PID would be in the range of 0-32767 (0 is reserved for the
|
||||
/* A valid PID would be in the range of 0-INT_MAX (0 is reserved for the
|
||||
* IDLE thread).
|
||||
*/
|
||||
|
||||
if (tmp >= 32768)
|
||||
if (tmp > INT_MAX)
|
||||
{
|
||||
ferr("ERROR: Invalid PID %ld\n", tmp);
|
||||
return -ENOENT;
|
||||
@@ -1701,11 +1701,11 @@ static int proc_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir)
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
/* A valid PID would be in the range of 0-32767 (0 is reserved for the
|
||||
/* A valid PID would be in the range of 0-INT_MAX (0 is reserved for the
|
||||
* IDLE thread).
|
||||
*/
|
||||
|
||||
if (tmp >= 32768)
|
||||
if (tmp > INT_MAX)
|
||||
{
|
||||
ferr("ERROR: Invalid PID %ld\n", tmp);
|
||||
return -ENOENT;
|
||||
@@ -1947,11 +1947,11 @@ static int proc_stat(const char *relpath, struct stat *buf)
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
/* A valid PID would be in the range of 0-32767 (0 is reserved for the
|
||||
/* A valid PID would be in the range of 0-INT_MAX (0 is reserved for the
|
||||
* IDLE thread).
|
||||
*/
|
||||
|
||||
if (tmp >= 32768)
|
||||
if (tmp > INT_MAX)
|
||||
{
|
||||
ferr("ERROR: Invalid PID %ld\n", tmp);
|
||||
return -ENOENT;
|
||||
|
||||
Reference in New Issue
Block a user