]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
misc: cosmetics, remove argument from usage(FILE*)
authorRuediger Meier <ruediger.meier@ga-group.nl>
Tue, 20 Jun 2017 18:20:29 +0000 (20:20 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Mon, 26 Jun 2017 12:38:24 +0000 (14:38 +0200)
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>
40 files changed:
Documentation/boilerplate.c
disk-utils/cfdisk.c
disk-utils/sfdisk.c
login-utils/last.c
login-utils/lslogins.c
login-utils/newgrp.c
login-utils/nologin.c
login-utils/utmpdump.c
login-utils/vipw.c
misc-utils/fincore.c
misc-utils/findmnt.c
misc-utils/kill.c
misc-utils/logger.c
misc-utils/lsblk.c
misc-utils/lslocks.c
misc-utils/mcookie.c
misc-utils/uuidd.c
misc-utils/uuidgen.c
sys-utils/blkzone.c
sys-utils/ctrlaltdel.c
sys-utils/eject.c
sys-utils/fallocate.c
sys-utils/hwclock.c
sys-utils/ipcs.c
sys-utils/lsns.c
sys-utils/prlimit.c
sys-utils/readprofile.c
sys-utils/setpriv.c
sys-utils/wdctl.c
sys-utils/zramctl.c
term-utils/script.c
term-utils/scriptreplay.c
term-utils/wall.c
text-utils/colcrt.c
text-utils/colrm.c
text-utils/hexdump.c
text-utils/hexdump.h
text-utils/line.c
text-utils/rev.c
text-utils/ul.c

index b70955d543d63048e3efa7c781ebc52f87751228..d0c163d8cea0b4ee838f82a1cc06965f97f5f172 100644 (file)
@@ -34,8 +34,9 @@
  * Other usage() constants that are not demonstrated below:
  * USAGE_FUNCTIONS USAGE_COMMANDS USAGE_COLUMNS
  */
-static void __attribute__((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options] file...\n"), program_invocation_short_name);
 
@@ -58,7 +59,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
        fputs(USAGE_HELP, out);
        fputs(USAGE_VERSION, out);
        fprintf(out, USAGE_MAN_TAIL("fixme-command-name(1)"));
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 int main(int argc, char **argv)
@@ -101,7 +102,7 @@ int main(int argc, char **argv)
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
                case 'h':
-                       usage(stdout);
+                       usage();
                default:
                        errtryhelp(EXIT_FAILURE);
                }
index efff1b8252fc7264ba344b41ba58af4e5656ed8a..e17bc916713f1b0fb37f9a687ae546663df0c16c 100644 (file)
@@ -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;
index 2a75190f543dfd42d4ba0d17ba5dca6d0cf37803..6f88780d77c23a738cd4adeb4435e8744448a261 100644 (file)
@@ -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;
index 50451b2e2a4fec489636f8232f60f1ae6e020f76..9cf6eb377f36c126c1e2daa594ffa8a5825ebab8 100644 (file)
@@ -560,8 +560,9 @@ static int list(const struct last_control *ctl, struct utmpx *p, time_t logout_t
 }
 
 
-static void __attribute__((__noreturn__)) usage(const struct last_control *ctl, FILE *out)
+static void __attribute__((__noreturn__)) usage(const struct last_control *ctl)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out, _(
                " %s [options] [<username>...] [<tty>...]\n"), program_invocation_short_name);
@@ -953,7 +954,7 @@ int main(int argc, char **argv)
 
                switch(c) {
                case 'h':
-                       usage(&ctl, stdout);
+                       usage(&ctl);
                        break;
                case 'V':
                        printf(UTIL_LINUX_VERSION);
index c6c849e14d5b2b5bfd3eb091c414b9f5f82cd745..c15b347f2df79dcca69036e79193b6ba8d776a6f 100644 (file)
@@ -1219,8 +1219,9 @@ static int parse_time_mode(const char *s)
        errx(EXIT_FAILURE, _("unknown time format: %s"), s);
 }
 
-static void __attribute__((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        size_t i;
 
        fputs(USAGE_HEADER, out);
@@ -1261,7 +1262,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
 
        fprintf(out, USAGE_MAN_TAIL("lslogins(1)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 int main(int argc, char *argv[])
@@ -1365,7 +1366,7 @@ int main(int argc, char *argv[])
                        groups = optarg;
                        break;
                case 'h':
-                       usage(stdout);
+                       usage();
                        break;
                case 'L':
                        add_column(columns, ncolumns++, COL_LAST_TTY);
index 63a45cd6a010ac07923f5b6a091fc361a92b37ab..767ae4bcf5c4e693ed356863238c01db5ce0470a 100644 (file)
@@ -166,19 +166,20 @@ static int allow_setgid(const struct passwd *pe, const struct group *ge)
        return FALSE;
 }
 
-static void __attribute__((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
-       fprintf(out, USAGE_HEADER);
+       FILE *out = stdout;
+       fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s <group>\n"), program_invocation_short_name);
 
        fputs(USAGE_SEPARATOR, out);
        fputs(_("Log in to a new group.\n"), out);
 
-       fprintf(out, USAGE_OPTIONS);
-       fprintf(out, USAGE_HELP);
-       fprintf(out, USAGE_VERSION);
+       fputs(USAGE_OPTIONS, out);
+       fputs(USAGE_HELP,out);
+       fputs(USAGE_VERSION,out);
        fprintf(out, USAGE_MAN_TAIL("newgrp(1)"));
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 int main(int argc, char *argv[])
@@ -204,7 +205,7 @@ int main(int argc, char *argv[])
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
                case 'h':
-                       usage(stdout);
+                       usage();
                default:
                        errtryhelp(EXIT_FAILURE);
                }
index e950d2a3f296f312529023efc4dc9d620231fbe2..00b4b8af8a967017ad8b7348a9a63cd1573f05a0 100644 (file)
@@ -19,8 +19,9 @@
  * Always return EXIT_FAILURE (1), don't try to be smart!
  */
 
-static void __attribute__((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out,
                _(" %s [options]\n"), program_invocation_short_name);
@@ -53,7 +54,7 @@ int main(int argc, char *argv[])
        while ((c = getopt_long(argc, argv, "hV", longopts, NULL)) != -1) {
                switch (c) {
                case 'h':
-                       usage(stdout);
+                       usage();
                        break;
                case 'V':
                        printf(UTIL_LINUX_VERSION);
index 385a96bf99c42ea7835d03aa10bd04a2bbd73f18..5bcb4c35fdf2d40f6e71a24fd49dfa9343b6ceb0 100644 (file)
@@ -296,8 +296,9 @@ static void undump(FILE *in, FILE *out)
        free(linestart);
 }
 
-static void __attribute__((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
 
        fprintf(out,
@@ -314,7 +315,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
        fputs(USAGE_VERSION, out);
 
        fprintf(out, USAGE_MAN_TAIL("utmpdump(1)"));
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 int main(int argc, char **argv)
@@ -356,7 +357,7 @@ int main(int argc, char **argv)
                        break;
 
                case 'h':
-                       usage(stdout);
+                       usage();
                        break;
                case 'V':
                        printf(UTIL_LINUX_VERSION);
index 7d4a831de40f5ecf120b637e119acc06655df0b4..e3cca4906439db891937bd59e4f9076d864b588d 100644 (file)
@@ -296,8 +296,9 @@ static void edit_file(int is_shadow)
        ulckpwdf();
 }
 
-static void __attribute__((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out, " %s\n", program_invocation_short_name);
 
@@ -308,7 +309,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
        fputs(USAGE_HELP, out);
        fputs(USAGE_VERSION, out);
        fprintf(out, USAGE_MAN_TAIL("vipw(8)"));
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 int main(int argc, char *argv[])
@@ -339,7 +340,7 @@ int main(int argc, char *argv[])
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
                case 'h':
-                       usage(stdout);
+                       usage();
                default:
                        errtryhelp(EXIT_FAILURE);
                }
index 84b83c6f22c5506e67764a6c3b0d7be6cabbfebb..f1b9fa7586802c6bb594e990f1f254d63bc88703 100644 (file)
@@ -258,8 +258,9 @@ static int fincore_name(struct fincore_control *ctl,
        return rc;
 }
 
-static void __attribute__((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        size_t i;
 
        fputs(USAGE_HEADER, out);
@@ -283,7 +284,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
 
        fprintf(out, USAGE_MAN_TAIL("fincore(1)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 int main(int argc, char ** argv)
@@ -334,7 +335,7 @@ int main(int argc, char ** argv)
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
                case 'h':
-                       usage(stdout);
+                       usage();
                default:
                        errtryhelp(EXIT_FAILURE);
                }
index 7acc60a26bb25e21d7563bf60b7a84e5ee7803c0..5394d1a60da73ac74819838e6d29d1b48b2dd709 100644 (file)
@@ -1182,8 +1182,9 @@ static int uniq_fs_target_cmp(
        return !mnt_fs_match_target(a, mnt_fs_get_target(b), cache);
 }
 
-static void __attribute__((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        size_t i;
 
        fputs(USAGE_HEADER, out);
@@ -1254,7 +1255,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
 
        fprintf(out, USAGE_MAN_TAIL("findmnt(8)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 int main(int argc, char *argv[])
@@ -1377,7 +1378,7 @@ int main(int argc, char *argv[])
                        flags |= FL_EVALUATE;
                        break;
                case 'h':
-                       usage(stdout);
+                       usage();
                        break;
                case 'i':
                        flags |= FL_INVERT;
index 9046d76d1e0a09a1a411fc81c628168b6419236a..ecee26c4edcc7293c6f5f9b7a4240c22901d5985 100644 (file)
@@ -296,8 +296,9 @@ static int arg_to_signum(char *arg, int maskbit)
        return signame_to_signum(arg);
 }
 
-static void __attribute__((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options] <pid>|<name>...\n"), program_invocation_short_name);
 
@@ -321,7 +322,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
        fputs(USAGE_VERSION, out);
        fprintf(out, USAGE_MAN_TAIL("kill(1)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 static char **parse_arguments(int argc, char **argv, struct kill_control *ctl)
@@ -345,7 +346,7 @@ static char **parse_arguments(int argc, char **argv, struct kill_control *ctl)
                        exit(EXIT_SUCCESS);
                }
                if (!strcmp(arg, "-h") || !strcmp(arg, "--help"))
-                       usage(stdout);
+                       usage();
                if (!strcmp(arg, "--verbose")) {
                        ctl->verbose = 1;
                        continue;
index 653adae942db116f6e791ac51a3391263782b91b..0ae5c61d029ed8ff64d95d383c6c01206ae01e8c 100644 (file)
@@ -988,8 +988,9 @@ static void logger_close(const struct logger_ctl *ctl)
        free(ctl->hdr);
 }
 
-static void __attribute__ ((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options] [<message>]\n"), program_invocation_short_name);
 
@@ -1030,7 +1031,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE *out)
        fputs(USAGE_VERSION, out);
        fprintf(out, USAGE_MAN_TAIL("logger(1)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 /*
@@ -1160,7 +1161,7 @@ int main(int argc, char **argv)
                        printf(UTIL_LINUX_VERSION);
                        exit(EXIT_SUCCESS);
                case 'h':
-                       usage(stdout);
+                       usage();
                case OPT_OCTET_COUNT:
                        ctl.octet_count = 1;
                        break;
index dddd2a068bba976fd893d134dd55642d12eae0d0..d997bc71e4e2fc5ff90868e6437f9214b5e48041 100644 (file)
@@ -1622,8 +1622,9 @@ static int cmp_u64_cells(struct libscols_cell *a,
        return *adata == *bdata ? 0 : *adata >= *bdata ? 1 : -1;
 }
 
-static void __attribute__((__noreturn__)) help(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        size_t i;
 
        fputs(USAGE_HEADER, out);
@@ -1667,7 +1668,7 @@ static void __attribute__((__noreturn__)) help(FILE *out)
 
        fprintf(out, USAGE_MAN_TAIL("lsblk(8)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 static void check_sysdevblock(void)
@@ -1766,7 +1767,7 @@ int main(int argc, char *argv[])
                        parse_excludes(optarg);
                        break;
                case 'h':
-                       help(stdout);
+                       usage();
                        break;
                case 'J':
                        lsblk->flags |= LSBLK_JSON;
index b33ffc1798ea628f2e2cd53dfb12abd07686ccf5..54440496a8c651caaba9198c36e7966d2f6a9590 100644 (file)
@@ -484,8 +484,9 @@ static int show_locks(struct list_head *locks)
 }
 
 
-static void __attribute__ ((__noreturn__)) usage(FILE * out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        size_t i;
 
        fputs(USAGE_HEADER, out);
@@ -516,7 +517,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
 
        fprintf(out, USAGE_MAN_TAIL("lslocks(8)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 int main(int argc, char *argv[])
@@ -569,7 +570,7 @@ int main(int argc, char *argv[])
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
                case 'h':
-                       usage(stdout);
+                       usage();
                case 'n':
                        no_headings = 1;
                        break;
index cc2d7ce6a38b18e059b96e5d088b96392108856f..89b9a01ebcfdc3837e4cce60c556579f81096e58 100644 (file)
@@ -76,8 +76,9 @@ static uint64_t hash_file(struct mcookie_control *ctl, int fd)
        return count;
 }
 
-static void __attribute__ ((__noreturn__)) usage(FILE * out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options]\n"), program_invocation_short_name);
 
@@ -94,7 +95,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
        fputs(USAGE_VERSION, out);
        fprintf(out, USAGE_MAN_TAIL("mcookie(1)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 static void randomness_from_files(struct mcookie_control *ctl)
@@ -167,7 +168,7 @@ int main(int argc, char **argv)
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
                case 'h':
-                       usage(stdout);
+                       usage();
                default:
                        errtryhelp(EXIT_FAILURE);
                }
index 371975d631f4b9c34452f6ab5fb4cc9b77a1cb3f..faaa0c12fe16dfccf050e451e9225a90e69d92a3 100644 (file)
@@ -58,8 +58,9 @@ struct uuidd_cxt_t {
                        no_sock: 1;
 };
 
-static void __attribute__ ((__noreturn__)) usage(FILE * out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options]\n"), program_invocation_short_name);
        fputs(USAGE_SEPARATOR, out);
@@ -81,7 +82,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
        fputs(USAGE_HELP, out);
        fputs(USAGE_VERSION, out);
        fprintf(out, USAGE_MAN_TAIL("uuidd(8)"));
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 static void create_daemon(void)
@@ -633,7 +634,7 @@ int main(int argc, char **argv)
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
                case 'h':
-                       usage(stdout);
+                       usage();
                default:
                        errtryhelp(EXIT_FAILURE);
                }
index 4c1d47d5e163c69b9615e72025989f10f489ccee..77fda2fb3b5904de7996b85a2eedb92bd1b3e241 100644 (file)
@@ -18,8 +18,9 @@
 #include "c.h"
 #include "closestream.h"
 
-static void __attribute__ ((__noreturn__)) usage(FILE * out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out,
              _(" %s [options]\n"), program_invocation_short_name);
@@ -34,7 +35,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
        fputs(USAGE_HELP, out);
        fputs(USAGE_VERSION, out);
        fprintf(out, USAGE_MAN_TAIL("uuidgen(1)"));
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 int
@@ -70,7 +71,7 @@ main (int argc, char *argv[])
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
                case 'h':
-                       usage(stdout);
+                       usage();
                default:
                        errtryhelp(EXIT_FAILURE);
                }
index 8fd55c06670c9a780335e108f6db64f9c4f9cc1b..ee4902e45a0c6277b58e08a36b5629ce212b9c1d 100644 (file)
@@ -290,8 +290,9 @@ static int blkzone_reset(struct blkzone_control *ctl)
        return 0;
 }
 
-static void __attribute__((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        size_t i;
 
        fputs(USAGE_HEADER, out);
@@ -314,7 +315,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
        fputs(USAGE_VERSION, out);
 
        fprintf(out, USAGE_MAN_TAIL("blkzone(8)"));
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 int main(int argc, char **argv)
@@ -362,7 +363,7 @@ int main(int argc, char **argv)
 
                switch (c) {
                case 'h':
-                       usage(stdout);
+                       usage();
                        break;
                case 'c':
                        ctl.count = strtou32_or_err(optarg,
index 840945082d5890f2e73512c2fef5c5dcea39fa23..98c8ed83282df744734b5865449e0dab0fccef2e 100644 (file)
 #define LINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF
 #define LINUX_REBOOT_CMD_CAD_OFF 0x00000000
 
-static void __attribute__ ((__noreturn__)) usage(FILE * out)
+static void __attribute__((__noreturn__)) usage(void)
 {
-       fprintf(out, USAGE_HEADER);
+       FILE *out = stdout;
+       fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s hard|soft\n"), program_invocation_short_name);
 
-       fprintf(out, USAGE_SEPARATOR);
+       fputs(USAGE_SEPARATOR, out);
        fprintf(out, _("Set the function of the Ctrl-Alt-Del combination.\n"));
 
-       fprintf(out, USAGE_OPTIONS);
-       fprintf(out, USAGE_HELP);
-       fprintf(out, USAGE_VERSION);
+       fputs(USAGE_OPTIONS, out);
+       fputs(USAGE_HELP, out);
+       fputs(USAGE_VERSION,out);
        fprintf(out, USAGE_MAN_TAIL("ctrlaltdel(8)"));
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 static int get_cad(void)
@@ -98,7 +99,7 @@ int main(int argc, char **argv)
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
                case 'h':
-                       usage(stdout);
+                       usage();
                default:
                        errtryhelp(EXIT_FAILURE);
                }
index 7cdd2db6e2ef9537c79eaacd9316fbd009b8558d..296e5cba56637e8cf0600193709e0af05189d964 100644 (file)
@@ -127,8 +127,9 @@ static inline void info(const char *fmt, ...)
        va_end(va);
 }
 
-static void __attribute__ ((__noreturn__)) usage(FILE * out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out,
                _(" %s [options] [<device>|<mountpoint>]\n"), program_invocation_short_name);
@@ -164,7 +165,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
        fputs(_("\nBy default tries -r, -s, -f, and -q in order until success.\n"), out);
        fprintf(out, USAGE_MAN_TAIL("eject(1)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 
@@ -223,7 +224,7 @@ static void parse_args(struct eject_control *ctl, int argc, char **argv)
                        ctl->F_option = 1;
                        break;
                case 'h':
-                       usage(stdout);
+                       usage();
                        break;
                case 'i':
                        ctl->i_option = 1;
index 7bbc3686501136e3dd5dcf211d30657f5ef970cb..a2d21255227376f349ffa99aec76f7cce2785517 100644 (file)
@@ -76,8 +76,9 @@
 static int verbose;
 static char *filename;
 
-static void __attribute__((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out,
              _(" %s [options] <filename>\n"), program_invocation_short_name);
@@ -105,7 +106,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
 
        fprintf(out, USAGE_MAN_TAIL("fallocate(1)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 static loff_t cvtnum(char *s)
@@ -329,7 +330,7 @@ int main(int argc, char **argv)
 
                switch(c) {
                case 'h':
-                       usage(stdout);
+                       usage();
                        break;
                case 'c':
                        mode |= FALLOC_FL_COLLAPSE_RANGE;
index 07ad613855a16071636077939aa371dda3c1be35..f3448a569620fa793849772b4d5f760b396636e9 100644 (file)
@@ -1200,8 +1200,9 @@ static void out_version(void)
 }
 
 static void __attribute__((__noreturn__))
-usage(const struct hwclock_control *ctl, FILE *out)
+usage(const struct hwclock_control *ctl)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fputs(_(" hwclock [function] [option...]\n"), out);
 
@@ -1451,7 +1452,7 @@ int main(int argc, char **argv)
                        out_version();
                        return 0;
                case 'h':                       /* --help */
-                       usage(&ctl, stdout);
+                       usage(&ctl);
                default:
                        errtryhelp(EXIT_FAILURE);
                }
index 3c4e5df0ead33f73f0dced8d6265e54b8a6ec86c..943b09c4a6067841d86d0d996b47c87cd73e0211 100644 (file)
@@ -46,8 +46,9 @@ static void print_msg (int id, int unit);
 /* we read time as int64_t from /proc, so cast... */
 #define xctime(_x)     ctime((time_t *) (_x))
 
-static void __attribute__ ((__noreturn__)) usage(FILE * out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %1$s [resource-option...] [output-option]\n"
                       " %1$s -m|-q|-s -i <id>\n"), program_invocation_short_name);
@@ -78,7 +79,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
        fputs(_(" -b, --bytes       show sizes in bytes\n"), out);
        fprintf(out, USAGE_MAN_TAIL("ipcs(1)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 int main (int argc, char **argv)
@@ -150,7 +151,7 @@ int main (int argc, char **argv)
                        unit = IPC_UNIT_BYTES;
                        break;
                case 'h':
-                       usage(stdout);
+                       usage();
                case 'V':
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
index 05d3ec620e35dc6e24d2dfacfae513a1674e066b..6cadd0ef558eed52e1d49133d07612147bc9077e 100644 (file)
@@ -603,8 +603,9 @@ static int show_namespace_processes(struct lsns *ls, struct lsns_namespace *ns)
        return 0;
 }
 
-static void __attribute__ ((__noreturn__)) usage(FILE * out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        size_t i;
 
        fputs(USAGE_HEADER, out);
@@ -635,7 +636,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
 
        fprintf(out, USAGE_MAN_TAIL("lsns(8)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 
@@ -698,7 +699,7 @@ int main(int argc, char *argv[])
                        ls.fltr_pid = strtos32_or_err(optarg, _("invalid PID argument"));
                        break;
                case 'h':
-                       usage(stdout);
+                       usage();
                case 'n':
                        ls.no_headings = 1;
                        break;
index 302103f8bdae5c4e8da11fef13778a6cd4fbb394..44db54ca566f84bd487840db284ae52445ee99b6 100644 (file)
@@ -151,8 +151,9 @@ static int prlimit(pid_t p, int resource,
 }
 #endif
 
-static void __attribute__ ((__noreturn__)) usage(FILE * out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        size_t i;
 
        fputs(USAGE_HEADER, out);
@@ -199,7 +200,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
 
        fprintf(out, USAGE_MAN_TAIL("prlimit(1)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 static inline int get_column_id(int num)
@@ -584,7 +585,7 @@ int main(int argc, char **argv)
                        pid = strtos32_or_err(optarg, _("invalid PID argument"));
                        break;
                case 'h':
-                       usage(stdout);
+                       usage();
                case 'o':
                        ncolumns = string_to_idarray(optarg,
                                                     columns, ARRAY_SIZE(columns),
index f18fa9bf2b8497b082f9895f2e4d4d4ccd29c4ad..dc14c64f230345fc6efd7ccf35d4b3d29a2903aa 100644 (file)
@@ -97,9 +97,9 @@ static char *boot_uname_r_str(void)
        return s;
 }
 
-static void __attribute__ ((__noreturn__))
-    usage(FILE * out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options]\n"), program_invocation_short_name);
 
@@ -125,7 +125,7 @@ static void __attribute__ ((__noreturn__))
        fputs(USAGE_HELP, out);
        fputs(USAGE_VERSION, out);
        fprintf(out, USAGE_MAN_TAIL("readprofile(8)"));
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 int main(int argc, char **argv)
@@ -211,7 +211,7 @@ int main(int argc, char **argv)
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
                case 'h':
-                       usage(stdout);
+                       usage();
                default:
                        errtryhelp(EXIT_FAILURE);
                }
index 8d996e8bec34c6ca5ce5e81ec13f8ce2d7a704fd..310e6938d233f2142fb55baf452cc8aec3b67d39 100644 (file)
@@ -92,8 +92,9 @@ struct privctx {
        const char *apparmor_profile;
 };
 
-static void __attribute__((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options] <program> [<argument>...]\n"),
                program_invocation_short_name);
@@ -127,7 +128,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
        fputs(_(" This tool can be dangerous.  Read the manpage, and be careful.\n"), out);
        fprintf(out, USAGE_MAN_TAIL("setpriv(1)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 static int real_cap_last_cap(void)
@@ -797,7 +798,7 @@ int main(int argc, char **argv)
                        opts.apparmor_profile = optarg;
                        break;
                case 'h':
-                       usage(stdout);
+                       usage();
                case 'V':
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
index 1790e8993b7a5f51bb43b25e3c8d78638b119c33..28a24c1f8ea5b1c70e686afdfd33948db80a35db 100644 (file)
@@ -165,8 +165,9 @@ static struct colinfo *get_column_info(unsigned num)
        return &infos[ get_column_id(num) ];
 }
 
-static void __attribute__ ((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        size_t i;
 
        fputs(USAGE_HEADER, out);
@@ -201,7 +202,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE *out)
 
        fprintf(out, USAGE_MAN_TAIL("wdctl(8)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 static void add_flag_line(struct libscols_table *table, struct wdinfo *wd, const struct wdflag *fl)
@@ -531,7 +532,7 @@ int main(int argc, char *argv[])
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
                case 'h':
-                       usage(stdout);
+                       usage();
                case 'F':
                        noflags = 1;
                        break;
index 7b001fe5d0c68f0db5068ebbf854a4d95f4892f6..948c58925ef3784898667a85e96b7645d922efcb 100644 (file)
@@ -517,8 +517,9 @@ static void status(struct zram *z)
        scols_unref_table(tb);
 }
 
-static void __attribute__ ((__noreturn__)) usage(FILE * out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        size_t i;
 
        fputs(USAGE_HEADER, out);
@@ -550,7 +551,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
                fprintf(out, " %11s  %s\n", infos[i].name, _(infos[i].help));
 
        fprintf(out, USAGE_MAN_TAIL("zramctl(8)"));
-       exit(out == stderr ? 1 : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 /* actions */
@@ -642,7 +643,7 @@ int main(int argc, char **argv)
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
                case 'h':
-                       usage(stdout);
+                       usage();
                default:
                        errtryhelp(EXIT_FAILURE);
                }
index f2fc2f59c6684c7ccdd8172bba766fb3628b35d8..c59ce7b11943c1dd6875dd0f2784dd85efad2a7c 100644 (file)
@@ -154,8 +154,9 @@ static inline time_t script_time(time_t *t)
 # define script_time(x) time(x)
 #endif
 
-static void __attribute__((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options] [file]\n"), program_invocation_short_name);
 
@@ -174,7 +175,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
                " -h, --help              display this help and exit\n\n"), out);
 
        fprintf(out, USAGE_MAN_TAIL("script(1)"));
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 static void die_if_link(const struct script_control *ctl)
@@ -736,7 +737,7 @@ int main(int argc, char **argv)
                        exit(EXIT_SUCCESS);
                        break;
                case 'h':
-                       usage(stdout);
+                       usage();
                        break;
                default:
                        errtryhelp(EXIT_FAILURE);
index 5fd3ecb164243e593ff809c28166186edfe4df19..a83f9a2ebf7362927f6239ed1aff73b38262f9c1 100644 (file)
@@ -36,8 +36,9 @@
 #define SCRIPT_MIN_DELAY 0.0001                /* from original sripreplay.pl */
 
 static void __attribute__((__noreturn__))
-usage(FILE *out)
+usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out,
              _(" %s [-t] timingfile [typescript] [divisor]\n"),
@@ -55,7 +56,7 @@ usage(FILE *out)
                " -h, --help              display this help and exit\n\n"), out);
 
        fprintf(out, USAGE_MAN_TAIL("scriptreplay(1)"));
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 static double
@@ -172,7 +173,7 @@ main(int argc, char *argv[])
                        printf(UTIL_LINUX_VERSION);
                        exit(EXIT_SUCCESS);
                case 'h':
-                       usage(stdout);
+                       usage();
                default:
                        errtryhelp(EXIT_FAILURE);
                        }
index 527e4b6dfcf52ec36272d5396fd8ea546c142fac..803a02976e5d79b360d9fce88146a3ccac0f0f91 100644 (file)
@@ -78,8 +78,9 @@
 static char *makemsg(char *fname, char **mvec, int mvecsz,
                    size_t *mbufsize, int print_banner);
 
-static void __attribute__((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out,
              _(" %s [options] [<file> | <message>]\n"), program_invocation_short_name);
@@ -96,7 +97,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
        fputs(USAGE_VERSION, out);
        fprintf(out, USAGE_MAN_TAIL("wall(1)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 struct group_workspace {
@@ -224,7 +225,7 @@ int main(int argc, char **argv)
                        printf(UTIL_LINUX_VERSION);
                        exit(EXIT_SUCCESS);
                case 'h':
-                       usage(stdout);
+                       usage();
                default:
                        errtryhelp(EXIT_FAILURE);
                }
index ff8cd46944ed980c91736dc7f00e656cfe33974c..375d0d6f0c826da641edab4ef893744178a15cc1 100644 (file)
@@ -75,8 +75,9 @@ struct colcrt_control {
                        half_lines:1;
 };
 
-static void __attribute__((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options] [<file>...]\n"), program_invocation_short_name);
 
@@ -93,7 +94,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
 
        fprintf(out, USAGE_MAN_TAIL("colcrt(1)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 static void trim_trailing_spaces(wchar_t *s)
@@ -264,7 +265,7 @@ int main(int argc, char **argv)
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
                case 'h':
-                       usage(stdout);
+                       usage();
                default:
                        errtryhelp(EXIT_FAILURE);
                }
index b2816cd074d6c7c5ddec06f3d49a3052f7e989b9..ebebca0bf300cf23dd516b724565c11e54790486 100644 (file)
@@ -54,8 +54,9 @@ COLRM removes unwanted columns from a file
        Jeff Schriebman  UC Berkeley 11-74
 */
 
-static void __attribute__ ((__noreturn__)) usage(FILE * out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fprintf(out, _("\nUsage:\n"
                       " %s [startcol [endcol]]\n"),
                       program_invocation_short_name);
@@ -69,7 +70,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
        fprintf(out, _("%s reads from standard input and writes to standard output\n\n"),
                       program_invocation_short_name);
        fprintf(out, USAGE_MAN_TAIL("colrm(1)"));
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 static int process_input(unsigned long first, unsigned long last)
@@ -176,7 +177,7 @@ int main(int argc, char **argv)
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
                case 'h':
-                       usage(stdout);
+                       usage();
                default:
                        errtryhelp(EXIT_FAILURE);
                }
index bf0631654141e0ce7767c30a56fde5de416f289a..53d10a6d94ccaac273ee6ec24548446c0480f53a 100644 (file)
@@ -131,7 +131,7 @@ parse_args(int argc, char **argv, struct hexdump *hex)
                        add_fmt("\"%07.7_ax \" 8/2 \"   %04x \" \"\\n\"", hex);
                        break;
                case 'h':
-                       usage(stdout);
+                       usage();
                case 'V':
                        printf(UTIL_LINUX_VERSION);
                        exit(EXIT_SUCCESS);
@@ -149,8 +149,9 @@ parse_args(int argc, char **argv, struct hexdump *hex)
        return optind;
 }
 
-void __attribute__((__noreturn__)) usage(FILE *out)
+void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options] <file>...\n"), program_invocation_short_name);
 
@@ -177,7 +178,7 @@ void __attribute__((__noreturn__)) usage(FILE *out)
        fputs(USAGE_VERSION, out);
        fprintf(out, USAGE_MAN_TAIL("hexdump(1)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 int main(int argc, char **argv)
index 741a57ad2ae17eb932421ff19a2ea8bec04630dc..4a8d10916ba3496f9b6515f5dfc04d7ba8456135 100644 (file)
@@ -101,7 +101,7 @@ void add_fmt(const char *, struct hexdump *);
 void rewrite_rules(struct hexdump_fs *, struct hexdump *);
 void addfile(char *, struct hexdump *);
 void display(struct hexdump *);
-void __attribute__((__noreturn__)) usage(FILE *out);
+void __attribute__((__noreturn__)) usage(void);
 void conv_c(struct hexdump_pr *, u_char *);
 void conv_u(struct hexdump_pr *, u_char *);
 int  next(char **, struct hexdump *);
index 486e5dd31fee72ea9188d8b13852df70eef6a439..15d7d4adfcd0417828250d51f904d2c0acc652c3 100644 (file)
@@ -24,8 +24,9 @@
 #include "nls.h"
 #include "widechar.h"
 
-static void __attribute__((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options]\n"), program_invocation_short_name);
 
@@ -36,7 +37,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
        fputs(USAGE_HELP, out);
        fputs(USAGE_VERSION, out);
        fprintf(out, USAGE_MAN_TAIL("line(1)"));
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 int main(int argc, char **argv)
@@ -62,7 +63,7 @@ int main(int argc, char **argv)
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
                case 'h':
-                       usage(stdout);
+                       usage();
                default:
                        errtryhelp(EXIT_FAILURE);
                }
index feed2b167c4effc6983f372bae078edd6bf36969..9a778e383a665c718bdc1fe2798ee27f03f9c297 100644 (file)
@@ -71,8 +71,9 @@ static void sig_handler(int signo __attribute__ ((__unused__)))
        _exit(EXIT_SUCCESS);
 }
 
-static void __attribute__ ((__noreturn__)) usage(FILE * out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fprintf(out, _("Usage: %s [options] [file ...]\n"),
                program_invocation_short_name);
 
@@ -84,7 +85,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
        fputs(USAGE_VERSION, out);
        fprintf(out, USAGE_MAN_TAIL("rev(1)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 static void reverse_str(wchar_t *str, size_t n)
@@ -125,7 +126,7 @@ int main(int argc, char *argv[])
                        printf(UTIL_LINUX_VERSION);
                        exit(EXIT_SUCCESS);
                case 'h':
-                       usage(stdout);
+                       usage();
                default:
                        errtryhelp(EXIT_FAILURE);
                }
index 736483ef481d90b4545e7d4ead1e31b9c2d2d7fd..a2ad5ea4211a0c702bd07971e8185b43a87d2d13 100644 (file)
@@ -135,9 +135,9 @@ static int  halfpos;
 static int     upln;
 static int     iflag;
 
-static void __attribute__((__noreturn__))
-usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options] [<file> ...]\n"), program_invocation_short_name);
 
@@ -153,7 +153,7 @@ usage(FILE *out)
 
        fprintf(out, USAGE_MAN_TAIL("ul(1)"));
 
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 int main(int argc, char **argv)
@@ -196,7 +196,7 @@ int main(int argc, char **argv)
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
                case 'h':
-                       usage(stdout);
+                       usage();
                default:
                        errtryhelp(EXIT_FAILURE);
                }