fs: mqueue: Change MAX_MQUEUE_PATH to 64

Summary:
- This commit changes MAX_MQUEUE_PATH to 64 to reduce stack
  memory if the NAME_MAX is large

Impact:
- None

Testing:
- Tested with spresense:rndis_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
Masayuki Ishikawa 2021-10-25 15:28:31 +09:00 committed by Xiang Xiao
parent 7e8003cba1
commit 585b1fc113
2 changed files with 3 additions and 2 deletions

View file

@ -177,7 +177,8 @@ static int file_mq_vopen(FAR struct file *mq, FAR const char *mq_name,
goto errout;
}
if (strlen(mq_name) > NAME_MAX)
if (sizeof(CONFIG_FS_MQUEUE_MPATH) + 1 + strlen(mq_name)
>= MAX_MQUEUE_PATH)
{
ret = -ENAMETOOLONG;
goto errout;

View file

@ -39,6 +39,6 @@
/* Sizes of things */
#define MAX_MQUEUE_PATH (sizeof(CONFIG_FS_MQUEUE_MPATH) + NAME_MAX)
#define MAX_MQUEUE_PATH 64
#endif /* __FS_MQUEUE_MQUEUE_H */