]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - disk-utils/mkfs.c
Make the ways of using output stream consistent in usage()
[thirdparty/util-linux.git] / disk-utils / mkfs.c
index f7b0c0a0904b7b19db92fde3fcdbe6f750e24aa4..58856d87160ef112ac82e445e4282dc50823dfb9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * mkfs                A simple generic frontend for the for the mkfs program
+ * mkfs                A simple generic frontend for the mkfs program
  *             under Linux.  See the manual page for details.
  *
  * Authors:    David Engel, <david@ods.com>
@@ -10,7 +10,7 @@
  *     Incorporated fix by Jonathan Kamens <jik@annex-1-slip-jik.cam.ov.com>
  * 1999-02-22 Arkadiusz Miƛkiewicz <misiek@pld.ORG.PL>
  * - added Native Language Support
- *     
+ *
  */
 
 /*
@@ -55,18 +55,12 @@ static void __attribute__((__noreturn__)) usage(void)
        fprintf(out, _("     <size>         number of blocks to be used on the device\n"));
        fprintf(out, _(" -V, --verbose      explain what is being done;\n"
                       "                      specifying -V more than once will cause a dry-run\n"));
-       print_usage_help_options(20);
+       fprintf(out, USAGE_HELP_OPTIONS(20));
 
        fprintf(out, USAGE_MAN_TAIL("mkfs(8)"));
        exit(EXIT_SUCCESS);
 }
 
-static void __attribute__ ((__noreturn__)) print_version(void)
-{
-       printf(UTIL_LINUX_VERSION);
-       exit(EXIT_SUCCESS);
-}
-
 int main(int argc, char **argv)
 {
        char *progname;         /* name of executable to be called */
@@ -86,10 +80,10 @@ int main(int argc, char **argv)
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
-       atexit(close_stdout);
+       close_stdout_atexit();
 
        if (argc == 2 && !strcmp(argv[1], "-V"))
-               print_version();
+               print_version(EXIT_SUCCESS);
 
        /* Check commandline options. */
        opterr = 0;
@@ -106,7 +100,7 @@ int main(int argc, char **argv)
                case 'h':
                        usage();
                case VERSION_OPTION:
-                       print_version();
+                       print_version(EXIT_SUCCESS);
                default:
                        optind--;
                        more = 1;