+2009-04-28 Nicolas François <nicolas.francois@centraliens.net>
+
+ * libmisc/utmp.c, src/userdel.c, src/logoutd.c: Replace #if by #ifdef
+
2009-04-28 Nicolas François <nicolas.francois@centraliens.net>
* src/vipw.c: Harmonize messages.
#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;
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;
* 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;
exit (0);
}
-#if HAVE_UTMPX_H
+#ifdef USE_UTMPX
endutxent ();
-#else
+#else /* !USE_UTMPX */
endutent ();
-#endif
+#endif /* !USE_UTMPX */
#ifndef DEBUG
sleep (60);
* 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;