diff options
author | Ruediger Meier | 2017-06-19 20:52:50 +0200 |
---|---|---|
committer | Ruediger Meier | 2017-06-26 14:38:24 +0200 |
commit | 6e1eda6f229f87b77471ce6eb7cbf0ede7c8029e (patch) | |
tree | 5e74a0cd99493e934780db2b434c75e995a6bd17 /sys-utils/fstrim.c | |
parent | misc: never use usage(ERROR) (diff) | |
download | kernel-qcow2-util-linux-6e1eda6f229f87b77471ce6eb7cbf0ede7c8029e.tar.gz kernel-qcow2-util-linux-6e1eda6f229f87b77471ce6eb7cbf0ede7c8029e.tar.xz kernel-qcow2-util-linux-6e1eda6f229f87b77471ce6eb7cbf0ede7c8029e.zip |
misc: never use usage(stderr)
Here we fix all cases where we have usage(FILE*)
functions.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'sys-utils/fstrim.c')
-rw-r--r-- | sys-utils/fstrim.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys-utils/fstrim.c b/sys-utils/fstrim.c index c400a61b5..698f30a93 100644 --- a/sys-utils/fstrim.c +++ b/sys-utils/fstrim.c @@ -244,8 +244,9 @@ static int fstrim_all(struct fstrim_range *rangetpl, int verbose) return EXIT_SUCCESS; } -static void __attribute__((__noreturn__)) usage(FILE *out) +static void __attribute__((__noreturn__)) usage(void) { + FILE *out = stdout; fputs(USAGE_HEADER, out); fprintf(out, _(" %s [options] <mount point>\n"), program_invocation_short_name); @@ -264,7 +265,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out) fputs(USAGE_HELP, out); fputs(USAGE_VERSION, out); fprintf(out, USAGE_MAN_TAIL("fstrim(8)")); - exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS); + exit(EXIT_SUCCESS); } int main(int argc, char **argv) @@ -298,7 +299,7 @@ int main(int argc, char **argv) all = 1; break; case 'h': - usage(stdout); + usage(); break; case 'V': printf(UTIL_LINUX_VERSION); @@ -332,7 +333,7 @@ int main(int argc, char **argv) if (optind != argc) { warnx(_("unexpected number of arguments")); - usage(stderr); + errtryhelp(EXIT_FAILURE); } if (all) |