]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
misc: cosmetics, remove argument from usage(int)
authorRuediger Meier <ruediger.meier@ga-group.nl>
Tue, 20 Jun 2017 18:30:29 +0000 (20:30 +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(0).

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
misc-utils/blkid.c
sys-utils/nsenter.c
sys-utils/unshare.c
text-utils/column.c

index 52179e5e1d0e19d289f77913856cf7ddead9a65c..f4757e8c8ad1c277ec465c385d3c24d3dd26bf09 100644 (file)
@@ -68,9 +68,9 @@ static void print_version(FILE *out)
                LIBBLKID_VERSION, LIBBLKID_DATE);
 }
 
-static void usage(int error)
+static void __attribute__((__noreturn__)) usage(void)
 {
-       FILE *out = error ? stderr : stdout;
+       FILE *out = stdout;
 
        fputs(USAGE_HEADER, out);
        fprintf(out, _( " %s --label <label> | --uuid <uuid>\n\n"), program_invocation_short_name);
@@ -106,7 +106,7 @@ static void usage(int error)
        fputs(USAGE_HELP, out);
        fputs(USAGE_VERSION, out);
        fprintf(out, USAGE_MAN_TAIL("blkid(8)"));
-       exit(error);
+       exit(EXIT_SUCCESS);
 }
 
 /*
@@ -794,7 +794,7 @@ int main(int argc, char **argv)
                        /* ignore - backward compatibility */
                        break;
                case 'h':
-                       usage(0);
+                       usage();
                        break;
                default:
                        errtryhelp(EXIT_FAILURE);
index 6ad0b0fe0bb121afa0c63bb10c43c6aa67ba142e..204e6ce3b315550ca1e152804110d1c87c3e8683 100644 (file)
@@ -65,9 +65,9 @@ static struct namespace_file {
        { .nstype = 0, .name = NULL, .fd = -1 }
 };
 
-static void __attribute__((__noreturn__)) usage(int status)
+static void __attribute__((__noreturn__)) usage(void)
 {
-       FILE *out = status == EXIT_SUCCESS ? stdout : stderr;
+       FILE *out = stdout;
 
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options] [<program> [<argument>...]]\n"),
@@ -101,7 +101,7 @@ static void __attribute__((__noreturn__)) usage(int status)
        fputs(USAGE_VERSION, out);
        fprintf(out, USAGE_MAN_TAIL("nsenter(1)"));
 
-       exit(status);
+       exit(EXIT_SUCCESS);
 }
 
 static pid_t namespace_target_pid = 0;
@@ -253,7 +253,7 @@ int main(int argc, char *argv[])
                            longopts, NULL)) != -1) {
                switch (c) {
                case 'h':
-                       usage(EXIT_SUCCESS);
+                       usage();
                case 'V':
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
index 80fa0d3569219fea94a1cd8599d863543ec38189..d3973527b750ab5fc7e82ab2fb6a35face14f771 100644 (file)
@@ -238,9 +238,9 @@ static void bind_ns_files_from_child(pid_t *child, int fds[2])
        }
 }
 
-static void __attribute__((__noreturn__)) usage(int status)
+static void __attribute__((__noreturn__)) usage(void)
 {
-       FILE *out = status == EXIT_SUCCESS ? stdout : stderr;
+       FILE *out = stdout;
 
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options] [<program> [<argument>...]]\n"),
@@ -269,7 +269,7 @@ static void __attribute__((__noreturn__)) usage(int status)
        fputs(USAGE_VERSION, out);
        fprintf(out, USAGE_MAN_TAIL("unshare(1)"));
 
-       exit(status);
+       exit(EXIT_SUCCESS);
 }
 
 int main(int argc, char *argv[])
@@ -321,7 +321,7 @@ int main(int argc, char *argv[])
                        forkit = 1;
                        break;
                case 'h':
-                       usage(EXIT_SUCCESS);
+                       usage();
                case 'V':
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
index 1144ef87a54ce82a233eb471903bd871e792881e..7f956f721dda10b5a8d0eb712d4755d8418a9698 100644 (file)
@@ -546,9 +546,9 @@ static void simple_print(struct column_control *ctl)
        }
 }
 
-static void __attribute__((__noreturn__)) usage(int rc)
+static void __attribute__((__noreturn__)) usage(void)
 {
-       FILE *out = rc == EXIT_FAILURE ? stderr : stdout;
+       FILE *out = stdout;
 
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options] [<file>...]\n"), program_invocation_short_name);
@@ -585,7 +585,7 @@ static void __attribute__((__noreturn__)) usage(int rc)
        fputs(USAGE_VERSION, out);
        fprintf(out, USAGE_MAN_TAIL("column(1)"));
 
-       exit(rc);
+       exit(EXIT_SUCCESS);
 }
 
 int main(int argc, char **argv)
@@ -657,7 +657,7 @@ int main(int argc, char **argv)
                        ctl.tab_colhide = optarg;
                        break;
                case 'h':
-                       usage(EXIT_SUCCESS);
+                       usage();
                        break;
                case 'i':
                        ctl.tree_id = optarg;