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

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

commit 0aab82e9692dfffad1139eec2ae4a7a20d1bf0b8
Author: makejian <[email protected]>
AuthorDate: Mon Oct 27 21:36:54 2025 +0800

    signal: fix pselect misra coverity
    
    Convert tv_nsec to tv_usec with an explicit division and cast instead
    of the NSEC2USEC macro so the narrowing is visible to Coverity.
    
    Signed-off-by: makejian <[email protected]>
    Signed-off-by: zhangyuan29 <[email protected]>
---
 sched/signal/sig_pselect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sched/signal/sig_pselect.c b/sched/signal/sig_pselect.c
index b28096d12e6..543c11ce85d 100644
--- a/sched/signal/sig_pselect.c
+++ b/sched/signal/sig_pselect.c
@@ -116,7 +116,7 @@ int pselect(int nfds, FAR fd_set *readfds, FAR fd_set 
*writefds,
       if (timeout)
         {
           timeval_buf.tv_sec  = timeout->tv_sec;
-          timeval_buf.tv_usec = NSEC2USEC(timeout->tv_nsec);
+          timeval_buf.tv_usec = (long)(timeout->tv_nsec / NSEC_PER_USEC);
           timeval = &timeval_buf;
         }
 

Reply via email to