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

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


The following commit(s) were added to refs/heads/master by this push:
     new a21476bea netutils/netinit: Reduce net monitor delay on platforms 
without 64 bit time type.
a21476bea is described below

commit a21476beab938c44ec61ea2ef905a6938bc54b4e
Author: Stuart Ianna <[email protected]>
AuthorDate: Tue Oct 24 11:49:04 2023 +1100

    netutils/netinit: Reduce net monitor delay on platforms without 64 bit time 
type.
    
    Waiting for an hour can cause the calculated tick count in nxsem_clockwait 
to overflow due to the default width of sclock_t.
    
    Reduce the long wait period on platforms not using 64-bit time.
---
 netutils/netinit/netinit.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/netutils/netinit/netinit.c b/netutils/netinit/netinit.c
index f9ad0e4c6..80bdcbb30 100644
--- a/netutils/netinit/netinit.c
+++ b/netutils/netinit/netinit.c
@@ -207,8 +207,13 @@
  * signal indicating a change in network status.
  */
 
-#define LONG_TIME_SEC    (60*60) /* One hour in seconds */
-#define SHORT_TIME_SEC   (2)     /* 2 seconds */
+#ifdef CONFIG_SYSTEM_TIME64
+#  define LONG_TIME_SEC    (60*60)   /* One hour in seconds */
+#else
+#  define LONG_TIME_SEC    (5*60)    /* Five minutes in seconds */
+#endif
+
+#define SHORT_TIME_SEC     (2)       /* 2 seconds */
 
 /****************************************************************************
  * Private Data

Reply via email to