diff --git a/fs/mqueue/Kconfig b/fs/mqueue/Kconfig index 284ddb15155..7cf1255c95a 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 f47ea16d5f7..1529e67160c 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 a0a5afeae4c..58b82f9111d 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. */