From 938a995c92375913f75e127a86d85ff5da286dd2 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 6 Feb 2022 00:30:34 +0800 Subject: [PATCH] mqueue: Rename FS_MQUEUE_MPATH to FS_MQUEUE_VFS_PATH align with other similiar config which suffix with _VFS_PATH Signed-off-by: Xiang Xiao --- fs/mqueue/Kconfig | 2 +- fs/mqueue/mq_open.c | 7 ++++--- fs/mqueue/mq_unlink.c | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/fs/mqueue/Kconfig b/fs/mqueue/Kconfig index 284ddb1515..7cf1255c95 100644 --- a/fs/mqueue/Kconfig +++ b/fs/mqueue/Kconfig @@ -5,7 +5,7 @@ if !DISABLE_MQUEUE -config FS_MQUEUE_MPATH +config FS_MQUEUE_VFS_PATH string "Path to message queue" default "/var/mqueue" ---help--- diff --git a/fs/mqueue/mq_open.c b/fs/mqueue/mq_open.c index f47ea16d5f..1529e67160 100644 --- a/fs/mqueue/mq_open.c +++ b/fs/mqueue/mq_open.c @@ -177,7 +177,7 @@ static int file_mq_vopen(FAR struct file *mq, FAR const char *mq_name, goto errout; } - if (sizeof(CONFIG_FS_MQUEUE_MPATH) + 1 + strlen(mq_name) + if (sizeof(CONFIG_FS_MQUEUE_VFS_PATH) + 1 + strlen(mq_name) >= MAX_MQUEUE_PATH) { ret = -ENAMETOOLONG; @@ -199,7 +199,7 @@ static int file_mq_vopen(FAR struct file *mq, FAR const char *mq_name, mode &= ~umask; /* Skip over any leading '/'. All message queue paths are relative to - * CONFIG_FS_MQUEUE_MPATH. + * CONFIG_FS_MQUEUE_VFS_PATH. */ while (*mq_name == '/') @@ -209,7 +209,8 @@ static int file_mq_vopen(FAR struct file *mq, FAR const char *mq_name, /* Get the full path to the message queue */ - snprintf(fullpath, MAX_MQUEUE_PATH, CONFIG_FS_MQUEUE_MPATH "/%s", mq_name); + snprintf(fullpath, MAX_MQUEUE_PATH, + CONFIG_FS_MQUEUE_VFS_PATH "/%s", mq_name); /* Make sure that the check for the existence of the message queue * and the creation of the message queue are atomic with respect to diff --git a/fs/mqueue/mq_unlink.c b/fs/mqueue/mq_unlink.c index a0a5afeae4..58b82f9111 100644 --- a/fs/mqueue/mq_unlink.c +++ b/fs/mqueue/mq_unlink.c @@ -105,7 +105,8 @@ int file_mq_unlink(FAR const char *mq_name) /* Get the full path to the message queue */ - snprintf(fullpath, MAX_MQUEUE_PATH, CONFIG_FS_MQUEUE_MPATH "/%s", mq_name); + snprintf(fullpath, MAX_MQUEUE_PATH, + CONFIG_FS_MQUEUE_VFS_PATH "/%s", mq_name); /* Get the inode for this message queue. */