summaryrefslogtreecommitdiffstats
path: root/login-utils/sulogin.c
diff options
context:
space:
mode:
authorSami Kerola2012-07-25 21:15:24 +0200
committerKarel Zak2012-07-26 11:09:44 +0200
commit9f94bdce6230454fa3d9e6dc67bf07fa666b6c1d (patch)
tree35a8a73b9c319a14082f79afd8adb4e6aa48989e /login-utils/sulogin.c
parentlibmount: fix shadow declaration (diff)
downloadkernel-qcow2-util-linux-9f94bdce6230454fa3d9e6dc67bf07fa666b6c1d.tar.gz
kernel-qcow2-util-linux-9f94bdce6230454fa3d9e6dc67bf07fa666b6c1d.tar.xz
kernel-qcow2-util-linux-9f94bdce6230454fa3d9e6dc67bf07fa666b6c1d.zip
sulogin: fix shadow declaration
login-utils/sulogin.c:337:8: warning: declaration of 'sushell' shadows a global declaration [-Wshadow] login-utils/sulogin.c:332:13: warning: shadowed declaration is here [-Wshadow] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'login-utils/sulogin.c')
-rw-r--r--login-utils/sulogin.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c
index 7ac493be2..d7d44b607 100644
--- a/login-utils/sulogin.c
+++ b/login-utils/sulogin.c
@@ -334,7 +334,7 @@ static void sushell(struct passwd *pwd)
char shell[PATH_MAX];
char home[PATH_MAX];
char *p;
- char *sushell;
+ char *su_shell;
/*
* Set directory and shell.
@@ -348,17 +348,17 @@ static void sushell(struct passwd *pwd)
}
if ((p = getenv("SUSHELL")) != NULL)
- sushell = p;
+ su_shell = p;
else if ((p = getenv("sushell")) != NULL)
- sushell = p;
+ su_shell = p;
else {
if (pwd->pw_shell[0])
- sushell = pwd->pw_shell;
+ su_shell = pwd->pw_shell;
else
- sushell = "/bin/sh";
+ su_shell = "/bin/sh";
}
- if ((p = strrchr(sushell, '/')) == NULL)
- p = sushell;
+ if ((p = strrchr(su_shell, '/')) == NULL)
+ p = su_shell;
else
p++;
@@ -378,7 +378,7 @@ static void sushell(struct passwd *pwd)
/*
* Try to execute a shell.
*/
- setenv("SHELL", sushell, 1);
+ setenv("SHELL", su_shell, 1);
unmask_signal(SIGINT, &saved_sigint);
unmask_signal(SIGTSTP, &saved_sigtstp);
unmask_signal(SIGQUIT, &saved_sigquit);
@@ -399,8 +399,8 @@ static void sushell(struct passwd *pwd)
free(level);
}
#endif
- execl(sushell, shell, NULL);
- warn(_("%s: exec failed"), sushell);
+ execl(su_shell, shell, NULL);
+ warn(_("%s: exec failed"), su_shell);
setenv("SHELL", "/bin/sh", 1);
execl("/bin/sh", profile ? "-sh" : "sh", NULL);