summaryrefslogtreecommitdiffstats
path: root/src/test/test-utmp.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* test-utmp: replace UT_LINESIZE/UT_NAMESIZE/UT_HOSTSIZE with sizeof_field()Lennart Poettering2024-09-061-12/+6
| | | | utmpx doesn't know these defines, hence fix them.
* basic/in-addr-util: add IN_ADDR_TO_STRINGZbigniew Jędrzejewski-Szmek2022-06-061-4/+1
| | | | | | | | | | | | | | | Since we don't need the error value, and the buffer is allocated with a fixed size, the whole logic provided by in_addr_to_string() becomes unnecessary, so it's enough to wrap inet_ntop() directly. inet_ntop() can only fail with ENOSPC. But we specify a buffer that is supposed to be large enough, so this should never fail. A bunch of tests of this are added. This allows all the wrappers like strna(), strnull(), strempty() to be dropped. The guard of 'if (DEBUG_LOGGING)' can be dropped from around log_debug(), because log_debug() implements the check outside of the function call. But log_link_debug() does not, so it we need it to avoid unnecessary evaluation of the formatting.
* tests: add a helper that dumps /run/utmp in detailZbigniew Jędrzejewski-Szmek2022-05-311-0/+61
utmpdump doesn't print all the details. Looking at the list if useful when trying to tweak the wall filtering logic. This doesn't do much, but at least it serves as a smoke test for the cleanup functions.