summaryrefslogtreecommitdiffstats
path: root/login-utils/chsh.c
diff options
context:
space:
mode:
Diffstat (limited to 'login-utils/chsh.c')
-rw-r--r--login-utils/chsh.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/login-utils/chsh.c b/login-utils/chsh.c
index 31750d5..19f0915 100644
--- a/login-utils/chsh.c
+++ b/login-utils/chsh.c
@@ -77,25 +77,13 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_(" -l, --list-shells print list of shells and exit\n"), fp);
fputs(USAGE_SEPARATOR, fp);
- printf(USAGE_HELP_OPTIONS(22));
+ fprintf(fp, USAGE_HELP_OPTIONS(22));
- printf(USAGE_MAN_TAIL("chsh(1)"));
+ fprintf(fp, USAGE_MAN_TAIL("chsh(1)"));
exit(EXIT_SUCCESS);
}
/*
- * print_shells () -- /etc/shells is outputted to stdout.
- */
-static void print_shells(void)
-{
- char *s;
-
- while ((s = getusershell()))
- printf("%s\n", s);
- endusershell();
-}
-
-/*
* parse_argv () --
* parse the command line arguments, and fill in "pinfo" with any
* information from the command line.
@@ -120,7 +108,7 @@ static void parse_argv(int argc, char **argv, struct sinfo *pinfo)
case 'h':
usage();
case 'l':
- print_shells();
+ print_shells(stdout, "%s\n");
exit(EXIT_SUCCESS);
case 's':
pinfo->shell = optarg;