From 2238785bf1bda701e0f18a8ea58e978b5fc68c3a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 10 Oct 2017 10:58:26 -0600 Subject: [PATCH] Fix a error introduced with nxmq_receive(); update TODO list. --- TODO | 13 +++++++++++-- libnx/nxmu/nx_eventhandler.c | 12 ++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/TODO b/TODO index 44b180e6886..3c3d0fd0522 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -NuttX TODO List (Last updated October 9, 2017) +NuttX TODO List (Last updated October 10, 2017) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This file summarizes known NuttX bugs, limitations, inconsistencies with @@ -248,9 +248,18 @@ o Task/Scheduler (sched/) semaphores used in the OS. Still need to checkout signals and messages queues that are also used in the OS. Also backed out commit b4747286b19d3b15193b2a5e8a0fe48fa0a8638c. - 2017-10-86: This change has been completed for the case of + 2017-10-06: This change has been completed for the case of signals used in the OS. Still need to checkout messages queues that are also used in the OS. + 2017-10-10: This change has been completed for the case of + message queue used in the OS. I am keeping this issue + open because (1) there are some known remaining calls that + that will modify the errno (such as dup(), dup2(), + sched_getparam(), sched_reprioritize(). sched_setaffinity(), + task_activate(), mq_open(), mq_close(), and others) and (2) + there may still be calls that create cancellation points. + Need to check things like open(), close(), read(), write(), + and possibly others. Status: Open Priority: Low. Things are working OK the way they are. But the design diff --git a/libnx/nxmu/nx_eventhandler.c b/libnx/nxmu/nx_eventhandler.c index 5c022221238..a82b10839a6 100644 --- a/libnx/nxmu/nx_eventhandler.c +++ b/libnx/nxmu/nx_eventhandler.c @@ -121,10 +121,10 @@ static inline void nx_disconnected(FAR struct nxfe_conn_s *conn) int nx_eventhandler(NXHANDLE handle) { FAR struct nxfe_conn_s *conn = (FAR struct nxfe_conn_s *)handle; - struct nxsvrmsg_s *msg; - struct nxbe_window_s *wnd; - char buffer[NX_MXCLIMSGLEN]; - int nbytes; + struct nxsvrmsg_s *msg; + struct nxbe_window_s *wnd; + char buffer[NX_MXCLIMSGLEN]; + int nbytes; /* Get the next message from our incoming message queue */ @@ -133,7 +133,7 @@ int nx_eventhandler(NXHANDLE handle) nbytes = _MQ_RECEIVE(conn->crdmq, buffer, NX_MXCLIMSGLEN, 0); if (nbytes < 0) { - int errcode = _MQ_GETERRNO(ret); + int errcode = _MQ_GETERRNO(nbytes); /* EINTR is not an error. The wait was interrupted by a signal and * we just need to try reading again. @@ -152,7 +152,7 @@ int nx_eventhandler(NXHANDLE handle) else { gerr("ERROR: _MQ_RECEIVE failed: %d\n", errcode); - _MQ_SETERRNO(ret); + _MQ_SETERRNO(nbytes); return ERROR; } }