From cb5acd69aaf7397d56e58d566f1f2663e86eeb6c Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 25 Aug 2011 12:09:38 +0200 Subject: login: cleanup begin of the login.c file Signed-off-by: Karel Zak --- login-utils/login.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'login-utils/login.c') diff --git a/login-utils/login.c b/login-utils/login.c index 8ef12af9a..1bbcddde5 100644 --- a/login-utils/login.c +++ b/login-utils/login.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #ifdef HAVE_LIBAUDIT @@ -58,32 +59,19 @@ #include #endif +#include "c.h" +#include "setproctitle.h" #include "pathnames.h" #include "login.h" #include "strutils.h" #include "nls.h" #include "xalloc.h" -#include "c.h" #define PAM_MAX_LOGIN_TRIES 3 #define is_pam_failure(_rc) ((_rc) != PAM_SUCCESS) -#include - #define SLEEP_EXIT_TIMEOUT 5 -#include "setproctitle.h" - -#ifndef HAVE_SECURITY_PAM_MISC_H -static void getloginname (void); -static void checknologin (void); -static int rootterm (char *ttyn); -#endif -static void timedout (int); -static void sigint (int); -static void motd (void); -static void dolastlog (int quiet); - #ifdef USE_TTY_GROUP # define TTY_MODE 0620 #else @@ -100,12 +88,12 @@ static void dolastlog (int quiet); * This bounds the time given to login. Not a define so it can * be patched on machines where it's too small. */ -int timeout = 60; +int timeout = 60; struct passwd *pwd; static struct passwd pwdcopy; -char hostaddress[16]; /* used in checktty.c */ +char hostaddress[16]; /* used in checktty.c */ sa_family_t hostfamily; /* used in checktty.c */ char *hostname; /* idem */ static char *username, *tty_name, *tty_number; @@ -113,6 +101,11 @@ static char thishost[100]; static int failures = 1; static pid_t pid; +static void timedout (int); +static void sigint (int); +static void motd (void); +static void dolastlog (int quiet); + /* Nice and simple code provided by Linus Torvalds 16-Feb-93 */ /* Nonblocking stuff by Maciej W. Rozycki, macro@ds2.pg.gda.pl, 1999. He writes: "Login performs open() on a tty in a blocking mode. -- cgit v1.2.3-55-g7522