From 27f9e01c77178887424c473cc9bc1f7b4f698606 Mon Sep 17 00:00:00 2001 From: Thorsten Kukuk Date: Wed, 18 Dec 2024 14:50:44 +0100 Subject: [PATCH] wmtpdb: call wtmpdb_* functions with NULL as path wtmpdb_*() funtions can only use the varlink interface if no wtmpdb path is specified. By default call it with NULL, only use a path if specified by the user. --- src/wtmpdb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wtmpdb.c b/src/wtmpdb.c index 3e71c58..74806b4 100644 --- a/src/wtmpdb.c +++ b/src/wtmpdb.c @@ -52,7 +52,7 @@ #include "wtmpdb.h" -static char *wtmpdb_path = _PATH_WTMPDB; +static char *wtmpdb_path = NULL; #define TIMEFMT_CTIME 1 #define TIMEFMT_SHORT 2 @@ -794,13 +794,13 @@ main_last (int argc, char **argv) } if (wtmp_start == UINT64_MAX) - printf ("%s has no entries\n", wtmpdb_path); + printf ("%s has no entries\n", wtmpdb_path?wtmpdb_path:"wtmpdb"); else if (time_fmt != TIMEFMT_NOTIME) { char wtmptime[32]; format_time (time_fmt, wtmptime, sizeof (wtmptime), wtmp_start/USEC_PER_SEC); - printf ("\n%s begins %s\n", wtmpdb_path, wtmptime); + printf ("\n%s begins %s\n", wtmpdb_path?wtmpdb_path:"wtmpdb", wtmptime); } return EXIT_SUCCESS; }