From b3240ac2431722c4e66efea0112cb998f373acea Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 7 Feb 2024 09:32:49 +1100 Subject: [PATCH] AP_Scripting: use gmtime_r() instead of gmtime() using gmtime_r makes gmtime thread safe --- libraries/AP_Scripting/lua/src/loslib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_Scripting/lua/src/loslib.c b/libraries/AP_Scripting/lua/src/loslib.c index de590c6b71..9510105778 100644 --- a/libraries/AP_Scripting/lua/src/loslib.c +++ b/libraries/AP_Scripting/lua/src/loslib.c @@ -81,7 +81,7 @@ static time_t l_checktime (lua_State *L, int arg) { ** where it uses gmtime_r/localtime_r */ -#if defined(LUA_USE_POSIX) /* { */ +#if defined(ARDUPILOT_BUILD) || defined(LUA_USE_POSIX) /* { */ #define l_gmtime(t,r) gmtime_r(t,r) #define l_localtime(t,r) localtime_r(t,r)