diff --git a/configs/mikroe-stm32f4/fulldemo/defconfig b/configs/mikroe-stm32f4/fulldemo/defconfig index f65118ce8cc..158b700dbf6 100644 --- a/configs/mikroe-stm32f4/fulldemo/defconfig +++ b/configs/mikroe-stm32f4/fulldemo/defconfig @@ -1663,7 +1663,7 @@ CONFIG_NXWM_TASKBAR_LEFT=y CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/sam3u-ek/nxwm/defconfig b/configs/sam3u-ek/nxwm/defconfig index 2ca2b66c45c..befaa84f552 100644 --- a/configs/sam3u-ek/nxwm/defconfig +++ b/configs/sam3u-ek/nxwm/defconfig @@ -1195,7 +1195,7 @@ CONFIG_NXWM_TASKBAR_LEFT=y CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/sam4e-ek/nxwm/defconfig b/configs/sam4e-ek/nxwm/defconfig index 9e628e8a36d..60e3a7ed6a4 100644 --- a/configs/sam4e-ek/nxwm/defconfig +++ b/configs/sam4e-ek/nxwm/defconfig @@ -1522,7 +1522,7 @@ CONFIG_NXWM_TOOLBAR_FONTID=5 CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/sama5d3x-ek/nxwm/defconfig b/configs/sama5d3x-ek/nxwm/defconfig index 7473154461d..fc158b4e7f5 100644 --- a/configs/sama5d3x-ek/nxwm/defconfig +++ b/configs/sama5d3x-ek/nxwm/defconfig @@ -1281,7 +1281,7 @@ CONFIG_NXWM_TOOLBAR_FONTID=6 CONFIG_NXWM_STARTWINDOW_VSPACING=8 CONFIG_NXWM_STARTWINDOW_HSPACING=8 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/sama5d4-ek/nxwm/defconfig b/configs/sama5d4-ek/nxwm/defconfig index c085fad274f..b4f9f7505a0 100644 --- a/configs/sama5d4-ek/nxwm/defconfig +++ b/configs/sama5d4-ek/nxwm/defconfig @@ -1674,7 +1674,7 @@ CONFIG_NXWM_TOOLBAR_FONTID=6 CONFIG_NXWM_STARTWINDOW_VSPACING=8 CONFIG_NXWM_STARTWINDOW_HSPACING=8 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/samv71-xult/nxwm/defconfig b/configs/samv71-xult/nxwm/defconfig index 0fecc15f8fb..109da749123 100644 --- a/configs/samv71-xult/nxwm/defconfig +++ b/configs/samv71-xult/nxwm/defconfig @@ -1321,7 +1321,7 @@ CONFIG_NXWM_TOOLBAR_FONTID=5 CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/samv71-xult/vnxwm/defconfig b/configs/samv71-xult/vnxwm/defconfig index 8a24d9550f4..e0339cb27db 100644 --- a/configs/samv71-xult/vnxwm/defconfig +++ b/configs/samv71-xult/vnxwm/defconfig @@ -1514,7 +1514,7 @@ CONFIG_NXWM_TOOLBAR_FONTID=5 CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/shenzhou/nxwm/defconfig b/configs/shenzhou/nxwm/defconfig index 20eef97c8b2..42d8ed2084e 100644 --- a/configs/shenzhou/nxwm/defconfig +++ b/configs/shenzhou/nxwm/defconfig @@ -1673,7 +1673,7 @@ CONFIG_NXWM_TASKBAR_LEFT=y CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/sim/nxwm/defconfig b/configs/sim/nxwm/defconfig index 882196f4372..7573cf969d0 100644 --- a/configs/sim/nxwm/defconfig +++ b/configs/sim/nxwm/defconfig @@ -979,7 +979,7 @@ CONFIG_NXWM_TASKBAR_LEFT=y CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/stm3220g-eval/nxwm/defconfig b/configs/stm3220g-eval/nxwm/defconfig index dcc4cf28bfa..a4889c9c5e8 100644 --- a/configs/stm3220g-eval/nxwm/defconfig +++ b/configs/stm3220g-eval/nxwm/defconfig @@ -1706,7 +1706,7 @@ CONFIG_NXWM_TASKBAR_LEFT=y CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/stm3240g-eval/knxwm/defconfig b/configs/stm3240g-eval/knxwm/defconfig index 74a0b95fccf..f3db5debcde 100644 --- a/configs/stm3240g-eval/knxwm/defconfig +++ b/configs/stm3240g-eval/knxwm/defconfig @@ -1389,7 +1389,7 @@ CONFIG_NXWM_TASKBAR_LEFT=y CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/stm3240g-eval/nxwm/defconfig b/configs/stm3240g-eval/nxwm/defconfig index c9e8c477d96..3ba430caecf 100644 --- a/configs/stm3240g-eval/nxwm/defconfig +++ b/configs/stm3240g-eval/nxwm/defconfig @@ -1711,7 +1711,7 @@ CONFIG_NXWM_TASKBAR_LEFT=y CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/stm32f429i-disco/nxwm/defconfig b/configs/stm32f429i-disco/nxwm/defconfig index da307b8cfb7..03750fdf1a2 100644 --- a/configs/stm32f429i-disco/nxwm/defconfig +++ b/configs/stm32f429i-disco/nxwm/defconfig @@ -1497,7 +1497,7 @@ CONFIG_NXWM_TASKBAR_LEFT=y CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/fs/mqueue/mq_open.c b/fs/mqueue/mq_open.c index 23258f9338f..a36497ed46c 100644 --- a/fs/mqueue/mq_open.c +++ b/fs/mqueue/mq_open.c @@ -100,12 +100,21 @@ mqd_t mq_open(FAR const char *mq_name, int oflags, ...) /* Make sure that a non-NULL name is supplied */ - if (!mq_name) + if (mq_name == NULL || *mq_name == '/0') { errcode = EINVAL; goto errout; } + /* Skip over any leading '/'. All message queue paths are relative to + * CONFIG_FS_MQUEUE_MPATH. + */ + + while (*mq_name == '/') + { + mq_name++; + } + /* Get the full path to the message queue */ snprintf(fullpath, MAX_MQUEUE_PATH, CONFIG_FS_MQUEUE_MPATH "/%s", mq_name); diff --git a/include/nuttx/nx/nx.h b/include/nuttx/nx/nx.h index ae4fc973793..0650128bcce 100644 --- a/include/nuttx/nx/nx.h +++ b/include/nuttx/nx/nx.h @@ -64,7 +64,7 @@ /* Default server MQ name used by nx_run() macro */ -#define NX_DEFAULT_SERVER_MQNAME "/dev/nxs" +#define NX_DEFAULT_SERVER_MQNAME "nxs" /* Mouse button bits */ diff --git a/include/nuttx/nx/nxmu.h b/include/nuttx/nx/nxmu.h index 49940aafd91..ca8481ebafb 100644 --- a/include/nuttx/nx/nxmu.h +++ b/include/nuttx/nx/nxmu.h @@ -71,8 +71,8 @@ /* Used to create unique client MQ name */ -#define NX_CLIENT_MQNAMEFMT "/dev/nxc%d" -#define NX_CLIENT_MXNAMELEN (16) +#define NX_CLIENT_MQNAMEFMT "nxc%d" +#define NX_CLIENT_MXNAMELEN (12) #define NX_MXSVRMSGLEN (64) /* Maximum size of a client->server command */ #define NX_MXEVENTLEN (64) /* Maximum size of an event */