]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
src/login.c: Group preprocessor conditionals
authorAlejandro Colomar <alx@kernel.org>
Sat, 26 Aug 2023 10:35:53 +0000 (12:35 +0200)
committerSerge Hallyn <serge@hallyn.com>
Wed, 13 Dec 2023 15:15:09 +0000 (09:15 -0600)
Group them at the end of the list of variable definitions, and use
'#if defined()' instead of '#if[n]def'.  Also indent nested ones.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/login.c

index d5ef87d8a928bc52fcfaaf468c114b65013c5db4..9f9e84157a1291a3a79fc986a48a9c57cd44082f 100644 (file)
@@ -478,21 +478,9 @@ int main (int argc, char **argv)
 {
        const char *tmptty;
        char tty[BUFSIZ];
-
-#ifdef RLOGIN
-       char term[128] = "";
-#endif                         /* RLOGIN */
-#if !defined(USE_PAM)
-#ifdef ENABLE_LASTLOG
-       char ptime[80];
-#endif /* ENABLE_LASTLOG */
-#endif
        unsigned int delay;
        unsigned int retries;
        bool subroot = false;
-#ifndef USE_PAM
-       bool is_console;
-#endif
        int err;
        unsigned int timeout;
        const char *cp;
@@ -503,13 +491,21 @@ int main (int argc, char **argv)
        const char *failent_user;
        char *host = NULL;
 
-#ifdef USE_PAM
+#if defined(USE_PAM)
        int retcode;
        pid_t child;
        char *pam_user = NULL;
 #else
+       bool is_console;
        struct spwd *spwd = NULL;
+# if defined(ENABLE_LASTLOG)
+       char ptime[80];
+# endif
+#endif
+#if defined(RLOGIN)
+       char term[128] = "";
 #endif
+
        /*
         * Some quick initialization.
         */