lib: libc: common: time: do not set errno in time()

The ISO C function time() is not specified to set the global
errno variable, so remove that in case there are side-effects.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
This commit is contained in:
Chris Friedt 2025-07-20 09:38:12 -04:00 committed by Benjamin Cabé
parent 54e16c4ad2
commit 05305e2647

View File

@ -5,7 +5,6 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <errno.h>
#include <time.h>
#include <zephyr/sys/clock.h>
@ -17,7 +16,6 @@ time_t time(time_t *tloc)
ret = sys_clock_gettime(SYS_CLOCK_REALTIME, &ts);
if (ret < 0) {
errno = -ret;
return (time_t) -1;
}