You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by je...@apache.org on 2020/07/30 14:16:34 UTC

[incubator-nuttx] 02/08: sched/sched/sched_waitpid.c: Remove a redundant assignment

This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 8b0d42275ef7b8b4c26f3b4444ac0065c636f15e
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Thu Jul 30 16:44:20 2020 +0900

    sched/sched/sched_waitpid.c: Remove a redundant assignment
    
    Found by clang-check:
    
    sched/sched_waitpid.c:380:33: warning: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret'
              (pid != (pid_t)-1 && (ret = nxsig_kill(pid, 0)) < 0))
                                    ^     ~~~~~~~~~~~~~~~~~~
    1 warning generated.
---
 sched/sched/sched_waitpid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sched/sched/sched_waitpid.c b/sched/sched/sched_waitpid.c
index 8518cba..c33186a 100644
--- a/sched/sched/sched_waitpid.c
+++ b/sched/sched/sched_waitpid.c
@@ -377,7 +377,7 @@ pid_t nx_waitpid(pid_t pid, int *stat_loc, int options)
        */
 
       if (rtcb->group->tg_nchildren == 0 ||
-          (pid != (pid_t)-1 && (ret = nxsig_kill(pid, 0)) < 0))
+          (pid != (pid_t)-1 && nxsig_kill(pid, 0) < 0))
         {
           /* We know that the child task was running okay when we started,
            * so we must have lost the signal.  What can we do?