]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - sys-utils/pivot_root.c
Make the ways of using output stream consistent in usage()
[thirdparty/util-linux.git] / sys-utils / pivot_root.c
index ea76d94bfe02fbabf27bc75f7eaaef1a3982b0da..6462a5b95f2925bec15716fb75b9a80dd77ba439 100644 (file)
@@ -38,8 +38,8 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_("Change the root filesystem.\n"), out);
 
        fputs(USAGE_OPTIONS, out);
-       printf(USAGE_HELP_OPTIONS(16));
-       printf(USAGE_MAN_TAIL("pivot_root(8)"));
+       fprintf(out, USAGE_HELP_OPTIONS(16));
+       fprintf(out, USAGE_MAN_TAIL("pivot_root(8)"));
        exit(EXIT_SUCCESS);
 }
 
@@ -55,13 +55,12 @@ int main(int argc, char **argv)
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
-       atexit(close_stdout);
+       close_stdout_atexit();
 
        while ((ch = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1)
                switch (ch) {
                case 'V':
-                       printf(UTIL_LINUX_VERSION);
-                       return EXIT_SUCCESS;
+                       print_version(EXIT_SUCCESS);
                case 'h':
                        usage();
                default: