You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/04/06 13:54:40 UTC

[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #741: Feature/fix wd start casts

patacongo commented on a change in pull request #741: Feature/fix wd start casts
URL: https://github.com/apache/incubator-nuttx/pull/741#discussion_r404108953
 
 

 ##########
 File path: sched/pthread/pthread_condtimedwait.c
 ##########
 @@ -67,61 +68,73 @@
  *
  ****************************************************************************/
 
-static void pthread_condtimedout(int argc, uint32_t pid, uint32_t signo)
+static void pthread_condtimedout(int argc, wdparm_t arg1, ...)
 {
-#ifdef HAVE_GROUP_MEMBERS
+  uint32_t pid = (uint32_t)arg1;
+  uint32_t signo;
+  va_list ap;
 
-  FAR struct tcb_s *tcb;
-  siginfo_t info;
+  /* Retrieve the variadic argument */
 
-  /* The logic below if equivalent to nxsig_queue(), but uses
-   * nxsig_tcbdispatch() instead of nxsig_dispatch().  This avoids the group
-   * signal deliver logic and assures, instead, that the signal is delivered
-   * specifically to this thread that is known to be waiting on the signal.
-   */
+  va_start(ap, arg1);
+  signo = (uint32_t)va_arg(ap, uint32_t);
 
 Review comment:
   Actual type is wdparm_t.  It will be a 64-bit uintpr_t on 64-bit machines, and 32-bits on others.  I don't think you can guarantee that uint32_t will always be correct.  Depending on endian-ness, this could grab the wrong 32-bits of the 32-bit value.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services