]> Savannah Git Hosting - gnulib.git/commit
readutmp: go back to simple ‘free’
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 3 Aug 2023 22:53:27 +0000 (15:53 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 4 Aug 2023 01:20:50 +0000 (18:20 -0700)
commit1ccde926759e8638d4b86de3dabbd948ad921edc
tree9550289ec6a071f081d1d4d5835f5ea54b482dbf
parent39a4cb0afdf4f2a1e6c2f3176b84e5b4cfe8996d
readutmp: go back to simple ‘free’

Omit the new free_utmp function.  Instead, allocate storage
in one block, so that using code can still just call ‘free’.
* lib/readutmp.c (struct utmp_alloc) [READUTMP_USE_SYSTEMD]: New type.
(add_utmp) [READUTMP_USE_SYSTEMD]: New function.
(read_utmp) [READUTMP_USE_SYSTEMD]: Use it.
Also, use malloc a bit less heavily.
(free_utmp): Remove.
* tests/test-readutmp.c (main): Call free, not free_utmp.
ChangeLog
NEWS
lib/readutmp.c
lib/readutmp.h
tests/test-readutmp.c