commit: b512e425c7dab2b7aec570b9830f99728fd61caf
parent f7f76feba067d99151125e39113366acd6857acd
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Tue, 11 Feb 2025 04:41:49 +0100
cmd/date: use clock_gettime instead of timespec_get
Gated behind C11 on at least glibc and it's otherwise a POSIX.1-2024 feature.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmd/date.c b/cmd/date.c
@@ -131,7 +131,7 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
errno = 0;
- if(timespec_get(&tp, TIME_UTC) != TIME_UTC)
+ if(clock_gettime(CLOCK_REALTIME, &tp) != 0)
{
fprintf(stderr, "%s: error: Failed getting current time: %s\n", argv0, strerror(errno));
return 1;