gentoo/dev-libs/libspt/files/libspt-1.1-timeval-in-utmp.patch
NHOrus 7ee4caa350
dev-libs/libspt: update EAPI 7 -> 8, fix gettimeofday usage
Closes: https://bugs.gentoo.org/943014
Signed-off-by: NHOrus <jy6x2b32pie9@yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/40776
Signed-off-by: Sam James <sam@gentoo.org>
2025-03-10 01:39:48 +00:00

18 lines
475 B
Diff

Switch to canonic handling of timeval possibly embedded in
struct utmp, see manpage.
https://bugs.gentoo.org/943014
--- a/sptagent.c
+++ b/sptagent.c
@@ -1033,7 +1033,10 @@
{
#ifdef HAVE_UTMP_UT_TV
#ifdef HAVE_GETTIMEOFDAY
- gettimeofday(&utptr->ut_tv, NULL);
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ utptr->ut_tv.tv_sec = tv.tv_sec;
+ utptr->ut_tv.tv_usec = tv.tv_usec;
#else
utptr->ut_tv.tv_sec = time(NULL);
utptr->ut_tv.ut_usec = 0;