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 1c91efa1c94801745a9fe3f28e35647d5869c9ea
Author: makejian <[email protected]>
AuthorDate: Mon Oct 27 21:36:14 2025 +0800

    signal: fix ppoll misra coverity
    
    Make the tv_sec/tv_nsec to milliseconds timeout conversion explicit
    with casts so the narrowing is visible to Coverity.
    
    Signed-off-by: makejian <[email protected]>
    Signed-off-by: zhangyuan29 <[email protected]>
---
 sched/signal/sig_ppoll.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sched/signal/sig_ppoll.c b/sched/signal/sig_ppoll.c
index 567a4d9f3ef..50f8a2bb7ff 100644
--- a/sched/signal/sig_ppoll.c
+++ b/sched/signal/sig_ppoll.c
@@ -117,8 +117,8 @@ int ppoll(FAR struct pollfd *fds, nfds_t nfds,
 
       if (timeout_ts)
         {
-          timeout = timeout_ts->tv_sec * MSEC_PER_SEC +
-                    NSEC2MSEC(timeout_ts->tv_nsec);
+          timeout = (int)(timeout_ts->tv_sec * MSEC_PER_SEC +
+                          timeout_ts->tv_nsec / NSEC_PER_MSEC);
         }
 
       ret = poll(fds, nfds, timeout);

Reply via email to