summaryrefslogtreecommitdiffstats
path: root/login-utils/chsh.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:30 +0000
commitc61e14d3a8412cd50d98aab604e607692c844c8a (patch)
tree4925aca0e6b64c8664ea2f3fdfa99a52dc93d5da /login-utils/chsh.c
parentAdding upstream version 2.39.3. (diff)
downloadutil-linux-c61e14d3a8412cd50d98aab604e607692c844c8a.tar.xz
util-linux-c61e14d3a8412cd50d98aab604e607692c844c8a.zip
Adding upstream version 2.40.upstream/2.40
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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;