From dd85562fac9acb6910f8f07c7a69a5212e481a27 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Tue, 28 Apr 2009 20:03:23 +0000 Subject: [PATCH] * libmisc/utmp.c, src/userdel.c, src/logoutd.c: Replace #if by #ifdef --- ChangeLog | 4 ++++ libmisc/utmp.c | 2 +- src/logoutd.c | 36 ++++++++++++++++++------------------ src/userdel.c | 6 +++--- 4 files changed, 26 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index be00e390..74298752 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-04-28 Nicolas François + + * libmisc/utmp.c, src/userdel.c, src/logoutd.c: Replace #if by #ifdef + 2009-04-28 Nicolas François * src/vipw.c: Harmonize messages. diff --git a/libmisc/utmp.c b/libmisc/utmp.c index b9c08533..976396d6 100644 --- a/libmisc/utmp.c +++ b/libmisc/utmp.c @@ -37,7 +37,7 @@ #include -#if USE_UTMPX +#ifdef USE_UTMPX #include #endif diff --git a/src/logoutd.c b/src/logoutd.c index 58cdf836..4acb8397 100644 --- a/src/logoutd.c +++ b/src/logoutd.c @@ -54,21 +54,21 @@ char *Prog; #endif /* local function prototypes */ -#if HAVE_UTMPX_H +#ifdef USE_UTMPX static int check_login (const struct utmpx *ut); -#else +#else /* !USE_UTMPX */ static int check_login (const struct utmp *ut); -#endif +#endif /* !USE_UTMPX */ static void send_mesg_to_tty (int tty_fd); /* * check_login - check if user (struct utmpx/utmp) allowed to stay logged in */ -#if HAVE_UTMPX_H +#ifdef USE_UTMPX static int check_login (const struct utmpx *ut) -#else +#else /* !USE_UTMPX */ static int check_login (const struct utmp *ut) -#endif +#endif /* !USE_UTMPX */ { char user[sizeof (ut->ut_user) + 1]; time_t now; @@ -147,11 +147,11 @@ int main (int argc, char **argv) int status; pid_t pid; -#if HAVE_UTMPX_H +#ifdef USE_UTMPX struct utmpx *ut; -#else +#else /* !USE_UTMPX */ struct utmp *ut; -#endif +#endif /* !USE_UTMPX */ char user[sizeof (ut->ut_user) + 1]; /* terminating NUL */ char tty_name[sizeof (ut->ut_line) + 6]; /* /dev/ + NUL */ int tty_fd; @@ -200,22 +200,22 @@ int main (int argc, char **argv) * Attempt to re-open the utmpx/utmp file. The file is only * open while it is being used. */ -#if HAVE_UTMPX_H +#ifdef USE_UTMPX setutxent (); -#else +#else /* !USE_UTMPX */ setutent (); -#endif +#endif /* !USE_UTMPX */ /* * Read all of the entries in the utmpx/utmp file. The entries * for login sessions will be checked to see if the user * is permitted to be signed on at this time. */ -#if HAVE_UTMPX_H +#ifdef USE_UTMPX while ((ut = getutxent ()) != NULL) -#else +#else /* !USE_UTMPX */ while ((ut = getutent ()) != NULL) -#endif +#endif /* !USE_UTMPX */ { if (ut->ut_type != USER_PROCESS) { continue; @@ -279,11 +279,11 @@ int main (int argc, char **argv) exit (0); } -#if HAVE_UTMPX_H +#ifdef USE_UTMPX endutxent (); -#else +#else /* !USE_UTMPX */ endutent (); -#endif +#endif /* !USE_UTMPX */ #ifndef DEBUG sleep (60); diff --git a/src/userdel.c b/src/userdel.c index ae1aa4a5..b75c7c13 100644 --- a/src/userdel.c +++ b/src/userdel.c @@ -590,17 +590,17 @@ static void user_busy (const char *name, uid_t uid) * We see if the user is logged in by looking for the user name * in the utmp file. */ -#if HAVE_UTMPX_H +#ifdef USE_UTMPX struct utmpx *utent; setutxent (); while ((utent = getutxent ()) != NULL) -#else +#else /* !USE_UTMPX */ struct utmp *utent; setutent (); while ((utent = getutent ()) != NULL) -#endif +#endif /* !USE_UTMPX */ { if (utent->ut_type != USER_PROCESS) continue;