]> Savannah Git Hosting - gnulib.git/commit
readutmp: switch new struct to struct timespec
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 3 Aug 2023 23:01:50 +0000 (16:01 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 4 Aug 2023 01:20:51 +0000 (18:20 -0700)
commitc0a858b24839d69858a5418f30971fd355b42fc4
tree8561da8d2e14bc26886a5e3c425c062c6d0b4bbf
parent2ab324f6789713e55e05ad7c50691995db2b0f85
readutmp: switch new struct to struct timespec

* lib/readutmp.c (get_boot_time_uncached, get_boot_time)
(add_utmp, read_utmp):
Use struct timespec, not struct timeval.
* lib/readutmp.h: Always include <time.h>, for struct timespec.
Simplify when utmp.h and utmpx.h are included.
(struct gl_utmp): Use the same struct for both the
systemd and the dummy version.  Reorder members, and
use proper pid_t type for ut_session.  Rename ut_tv to ut_ts
and make it a struct timespec.  All uses changed.
(HAVE_GL_UTMP): New macro.  Use it where appropriate, instead
of READUTMP_USE_SYSTEMD.
(UT_USER, HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID)
(HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_HOST):
Simplify.
* modules/readutmp (Depends-on): Add time-h, timespec_get.
Remove sys_type.  Sort.
ChangeLog
lib/readutmp.c
lib/readutmp.h
modules/readutmp