Skip to content

Commit

Permalink
src/login.c: Group preprocessor conditionals
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
alejandro-colomar committed Dec 4, 2023
1 parent 93a5c47 commit 28d70fb
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/login.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
# if defined(ENABLE_LASTLOG)
char ptime[80];
# endif
bool is_console;
struct spwd *spwd = NULL;
#endif
#if defined(RLOGIN)
char term[128] = "";
#endif

/*
* Some quick initialization.
*/
Expand Down

0 comments on commit 28d70fb

Please sign in to comment.