From a21476beab938c44ec61ea2ef905a6938bc54b4e Mon Sep 17 00:00:00 2001 From: Stuart Ianna Date: Tue, 24 Oct 2023 11:49:04 +1100 Subject: [PATCH] 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