diff options
author | Ruediger Meier | 2017-06-20 20:20:29 +0200 |
---|---|---|
committer | Ruediger Meier | 2017-06-26 14:38:24 +0200 |
commit | 86be6a32d3fd229dbb17bf5e3348a01e6e6e855a (patch) | |
tree | 04f05fd94b26d2b5a6304d69e93f2ec59e789e17 /disk-utils | |
parent | misc: cosmetics, remove argument from usage(int) (diff) | |
download | kernel-qcow2-util-linux-86be6a32d3fd229dbb17bf5e3348a01e6e6e855a.tar.gz kernel-qcow2-util-linux-86be6a32d3fd229dbb17bf5e3348a01e6e6e855a.tar.xz kernel-qcow2-util-linux-86be6a32d3fd229dbb17bf5e3348a01e6e6e855a.zip |
misc: cosmetics, remove argument from usage(FILE*)
This patch is trivial and changes nothing, because
we were always using usage(stdout)
Now all our usage() functions look very similar. If wanted we
could auto-generate another big cosmetical patch to remove all
the useless "FILE *out" constants and use printf and puts
rather than their f* friends. Such patch could be automatically
synchronized with the translation project (newlines!) to not
make the translators sick.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'disk-utils')
-rw-r--r-- | disk-utils/cfdisk.c | 7 | ||||
-rw-r--r-- | disk-utils/sfdisk.c | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c index efff1b825..e17bc9167 100644 --- a/disk-utils/cfdisk.c +++ b/disk-utils/cfdisk.c @@ -2542,8 +2542,9 @@ static int ui_run(struct cfdisk *cf) return 0; } -static void __attribute__ ((__noreturn__)) usage(FILE *out) +static void __attribute__((__noreturn__)) usage(void) { + FILE *out = stdout; fputs(USAGE_HEADER, out); fprintf(out, _(" %1$s [options] <disk>\n"), program_invocation_short_name); @@ -2562,7 +2563,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE *out) fputs(USAGE_VERSION, out); fprintf(out, USAGE_MAN_TAIL("cfdisk(8)")); - exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS); + exit(EXIT_SUCCESS); } int main(int argc, char *argv[]) @@ -2588,7 +2589,7 @@ int main(int argc, char *argv[]) while((c = getopt_long(argc, argv, "L::hVz", longopts, NULL)) != -1) { switch(c) { case 'h': - usage(stdout); + usage(); break; case 'L': colormode = UL_COLORMODE_AUTO; diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c index 2a75190f5..6f88780d7 100644 --- a/disk-utils/sfdisk.c +++ b/disk-utils/sfdisk.c @@ -1839,8 +1839,9 @@ static int command_fdisk(struct sfdisk *sf, int argc, char **argv) return rc; } -static void __attribute__ ((__noreturn__)) usage(FILE *out) +static void __attribute__((__noreturn__)) usage(void) { + FILE *out = stdout; fputs(USAGE_HEADER, out); fprintf(out, @@ -1906,7 +1907,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE *out) list_available_columns(out); fprintf(out, USAGE_MAN_TAIL("sfdisk(8)")); - exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS); + exit(EXIT_SUCCESS); } @@ -2042,7 +2043,7 @@ int main(int argc, char *argv[]) sf->act = ACT_SHOW_GEOM; break; case 'h': - usage(stdout); + usage(); break; case 'l': sf->act = ACT_LIST; |