From 41a41dd48e87dc309c16630f9a010273cd2e599d Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 21 Dec 1996 04:14:45 +0000 Subject: [PATCH] Replace hard-coded /etc/wtmp with WTMP_FILE. Suggestion from Eivind. --- src/who-users.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/who-users.c b/src/who-users.c index ec00d8c77..2cc153bd0 100644 --- a/src/who-users.c +++ b/src/who-users.c @@ -47,10 +47,14 @@ #include "system.h" #include "error.h" -#if !defined (UTMP_FILE) && defined (_PATH_UTMP) /* 4.4BSD. */ +#if !defined (UTMP_FILE) && defined (_PATH_UTMP) #define UTMP_FILE _PATH_UTMP #endif +#if !defined (WTMP_FILE) && defined (_PATH_WTMP) +#define WTMP_FILE _PATH_WTMP +#endif + #if defined (UTMPX_FILE) /* Solaris, SysVr4 */ #undef UTMP_FILE #define UTMP_FILE UTMPX_FILE @@ -639,9 +643,9 @@ usage (int status) --help display this help and exit\n\ --version output version information and exit\n\ \n\ -If FILE is not specified, use %s. /etc/wtmp as FILE is common.\n\ +If FILE is not specified, use %s. %s as FILE is common.\n\ If ARG1 ARG2 given, -m presumed: `am i' or `mom likes' are usual.\n\ -"), UTMP_FILE); +"), UTMP_FILE, WTMP_FILE); puts (_("\nReport bugs to sh-utils-bugs@gnu.ai.mit.edu")); } exit (status); @@ -660,10 +664,11 @@ usage (int status) printf (_("Usage: %s [OPTION]... [ FILE ]\n"), program_name); printf (_("\ Output who is currently logged in according to FILE.\n\ -If FILE is not specified, use %s. /etc/wtmp as FILE is common.\n\ +If FILE is not specified, use %s. %s as FILE is common.\n\ \n\ --help display this help and exit\n\ - --version output version information and exit\n"), UTMP_FILE); + --version output version information and exit\n"), + UTMP_FILE, WTMP_FILE); puts (_("\nReport bugs to sh-utils-bugs@gnu.ai.mit.edu")); } exit (status);