]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - sys-utils/renice.c
misc: consolidate version printing and close_stdout()
[thirdparty/util-linux.git] / sys-utils / renice.c
index a88f590fb2fa483986fd3d76fdbbfff4b42934f9..5efecdfd00b432137ced7540dedd338cc1539f68 100644 (file)
@@ -73,9 +73,8 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_(" -g, --pgrp <id>        interpret argument as process group ID\n"), out);
        fputs(_(" -u, --user <name>|<id> interpret argument as username or user ID\n"), out);
        fputs(USAGE_SEPARATOR, out);
-       fputs(USAGE_HELP, out);
-       fputs(USAGE_VERSION, out);
-       fprintf(out, USAGE_MAN_TAIL("renice(1)"));
+       printf(USAGE_HELP_OPTIONS(24));
+       printf(USAGE_MAN_TAIL("renice(1)"));
        exit(EXIT_SUCCESS);
 }
 
@@ -120,7 +119,7 @@ int main(int argc, char **argv)
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
-       atexit(close_stdout);
+       close_stdout_atexit();
 
        argc--;
        argv++;
@@ -132,10 +131,8 @@ int main(int argc, char **argv)
 
                if (strcmp(*argv, "-v") == 0 ||
                    strcmp(*argv, "-V") == 0 ||
-                   strcmp(*argv, "--version") == 0) {
-                       printf(UTIL_LINUX_VERSION);
-                       return EXIT_SUCCESS;
-               }
+                   strcmp(*argv, "--version") == 0)
+                       print_version(EXIT_SUCCESS);
        }
 
        if (*argv && (strcmp(*argv, "-n") == 0 || strcmp(*argv, "--priority") == 0)) {
@@ -150,7 +147,7 @@ int main(int argc, char **argv)
 
        prio = strtol(*argv, &endptr, 10);
        if (*endptr) {
-               warnx(_("invalid priorty '%s'"), *argv);
+               warnx(_("invalid priority '%s'"), *argv);
                errtryhelp(EXIT_FAILURE);
        }
        argc--;