summaryrefslogtreecommitdiff
path: root/nuttx/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/graphics')
-rw-r--r--nuttx/graphics/nxmu/nx_connect.c4
-rw-r--r--nuttx/graphics/nxmu/nxmu_server.c10
2 files changed, 6 insertions, 8 deletions
diff --git a/nuttx/graphics/nxmu/nx_connect.c b/nuttx/graphics/nxmu/nx_connect.c
index 401d20d92..0309e3d6c 100644
--- a/nuttx/graphics/nxmu/nx_connect.c
+++ b/nuttx/graphics/nxmu/nx_connect.c
@@ -152,7 +152,7 @@ NXHANDLE nx_connectionstance(FAR const char *svrmqname)
#else
conn->crdmq = mq_open(climqname, O_RDONLY|O_CREAT|O_NONBLOCK, 0666, &attr);
#endif
- if (conn->crdmq)
+ if (conn->crdmq == (mqd_t)-1)
{
gdbg("mq_open(%s) failed: %d\n", climqname, errno);
goto errout_with_conn;
@@ -165,7 +165,7 @@ NXHANDLE nx_connectionstance(FAR const char *svrmqname)
attr.mq_flags = 0;
conn->cwrmq = mq_open(svrmqname, O_WRONLY|O_CREAT, 0666, &attr);
- if (conn->cwrmq)
+ if (conn->cwrmq == (mqd_t)-1)
{
gdbg("mq_open(%s) failed: %d\n", svrmqname, errno);
goto errout_with_rmq;
diff --git a/nuttx/graphics/nxmu/nxmu_server.c b/nuttx/graphics/nxmu/nxmu_server.c
index 270285be2..352e56192 100644
--- a/nuttx/graphics/nxmu/nxmu_server.c
+++ b/nuttx/graphics/nxmu/nxmu_server.c
@@ -116,7 +116,7 @@ static inline void nxmu_connect(FAR struct nxfe_conn_s *conn)
outmsg.msgid = NX_CLIMSG_CONNECTED;
conn->swrmq = mq_open(mqname, O_WRONLY);
- if (conn->swrmq)
+ if (conn->swrmq == (mqd_t)-1)
{
gdbg("mq_open(%s) failed: %d\n", mqname, errno);
outmsg.msgid = NX_CLIMSG_DISCONNECTED;
@@ -224,7 +224,7 @@ static inline int nxmu_setup(FAR const char *mqname,
attr.mq_flags = 0;
fe->conn.crdmq = mq_open(mqname, O_RDONLY|O_CREAT, 0666, &attr);
- if (fe->conn.crdmq)
+ if (fe->conn.crdmq == (mqd_t)-1)
{
gdbg("mq_open(%s) failed: %d\n", mqname, errno);
return ERROR; /* mq_open sets errno */
@@ -239,10 +239,8 @@ static inline int nxmu_setup(FAR const char *mqname,
* the server message loop.
*/
- /* Open the server MQ for writing (same attributes) */
-
- fe->conn.cwrmq = mq_open(mqname, O_WRONLY);
- if (fe->conn.cwrmq)
+ fe->conn.swrmq = mq_open(mqname, O_WRONLY);
+ if (fe->conn.swrmq == (mqd_t)-1)
{
gdbg("mq_open(%s) failed: %d\n", mqname, errno);
mq_close(fe->conn.crdmq);