summaryrefslogtreecommitdiffstats
path: root/login-utils/chsh.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:34 +0000
commit1272be04be0cb803eec87f602edb2e3e6f111aea (patch)
treebce17f6478cdd9f3c4ec3d751135dc42786d6a56 /login-utils/chsh.c
parentReleasing progress-linux version 2.39.3-11~progress7.99u1. (diff)
downloadutil-linux-1272be04be0cb803eec87f602edb2e3e6f111aea.tar.xz
util-linux-1272be04be0cb803eec87f602edb2e3e6f111aea.zip
Merging upstream version 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;