]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - disk-utils/blockdev.c
misc: consolidate version printing and close_stdout()
[thirdparty/util-linux.git] / disk-utils / blockdev.c
index 5122460f0947d065e65c9ae0f18901f9f24a16a5..f1067c8152b2390345f673a39ffeb40e90f27f52 100644 (file)
@@ -238,7 +238,7 @@ int main(int argc, char **argv)
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
-       atexit(close_stdout);
+       close_stdout_atexit();
 
        if (argc < 2) {
                warnx(_("not enough arguments"));
@@ -246,10 +246,8 @@ int main(int argc, char **argv)
        }
 
        /* -V not together with commands */
-       if (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version")) {
-               printf(UTIL_LINUX_VERSION);
-               return EXIT_SUCCESS;
-       }
+       if (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version"))
+               print_version(EXIT_SUCCESS);
        if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help"))
                usage();