From 89662ba2daceed021528a603ffd20ebdbd1cfdd1 Mon Sep 17 00:00:00 2001 From: Mike Lowis Date: Thu, 28 Apr 2016 11:16:45 -0400 Subject: [PATCH] some minor cleanup for login.c --- source/login.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/source/login.c b/source/login.c index 7c5f0b63..78a96c6b 100644 --- a/source/login.c +++ b/source/login.c @@ -14,7 +14,6 @@ char* ARGV0; static char* Hostname = NULL; static char* Username = NULL; -static char* Password = NULL; static bool PreserveEnv = false; static char* get_host(void) { @@ -86,15 +85,9 @@ static struct passwd* check_pass(const char* user, char* pass) { int main(int argc, char** argv) { /* Parse command line options */ OPTBEGIN { - case 'p': - PreserveEnv = true; - break; - case 'h': - Hostname = EOPTARG(die("no hostname provided")); - break; - case 'u': - Username = EOPTARG(die("no username provided")); - break; + case 'p': PreserveEnv = true; break; + case 'h': Hostname = EOPTARG(die("no hostname provided")); break; + case 'u': Username = EOPTARG(die("no username provided")); break; default: fprintf(stderr,"Usage: %s [-p] [-h host] [-u user]", ARGV0); exit(EXIT_FAILURE); @@ -123,8 +116,7 @@ int main(int argc, char** argv) { check(chdir(pwentry->pw_dir), "chdir failed"); execlp(shell, shell, "-l", NULL); } - - /* Handle any unexpected errors that occurred */ + /* Landing pad for check macro failures */ error: return (errno == ENOENT) ? 127 : 126; } -- 2.54.0