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-apps.git

commit 7531007f0638b111e7f190e97230917cbeedddef
Author: wangjianyu3 <[email protected]>
AuthorDate: Fri Nov 13 15:38:38 2026 +0800

    nxinit: only retry pollers that declare events
    
    The simple property backend keeps its poll fd at -1, so the
    INIT_POLLER_RETRY_MS (100ms) retry woke init ten times a second.
    Only retry pollers that declare events.
    
    Assisted-by: OpenCode:mimo-v2.6-pro
    Signed-off-by: wangjianyu3 <[email protected]>
---
 system/nxinit/init.c            | 4 +++-
 system/nxinit/property_simple.c | 1 -
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/system/nxinit/init.c b/system/nxinit/init.c
index 632190cec..7dbace1b8 100644
--- a/system/nxinit/init.c
+++ b/system/nxinit/init.c
@@ -276,6 +276,8 @@ int main(int argc, FAR char *argv[])
       poller[i].sm = &sm;
       poller[i].am = &am;
       poller[i].pfd = &pfds[i];
+      pfds[i].fd = -1;
+      pfds[i].events = 0;
       r = poller[i].init(&poller[i]);
       if (r < 0)
         {
@@ -310,7 +312,7 @@ int main(int argc, FAR char *argv[])
 
       for (i = 0; t > INIT_POLLER_RETRY_MS && i < nitems(poller); i++)
         {
-          if (poller[i].pfd->fd < 0)
+          if (poller[i].pfd->fd < 0 && poller[i].pfd->events)
             {
               t = INIT_POLLER_RETRY_MS;
               break;
diff --git a/system/nxinit/property_simple.c b/system/nxinit/property_simple.c
index c8f12d9b9..9a347b85b 100644
--- a/system/nxinit/property_simple.c
+++ b/system/nxinit/property_simple.c
@@ -52,6 +52,5 @@ void init_property_deinit(FAR struct init_poller_s *ctx)
 int init_property_init(FAR struct init_poller_s *ctx)
 {
   ctx->am->prop = ctx;
-  ctx->pfd->fd = -1;
   return 0;
 }

Reply via email to