]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - misc-utils/findfs.c
Make the ways of using output stream consistent in usage()
[thirdparty/util-linux.git] / misc-utils / findfs.c
index fc16e44e6831a7a8332d180dff5c74da00637e91..7b32dbda33188b2eae7ef802ae91ef6def8e7ec0 100644 (file)
@@ -15,7 +15,6 @@
 #include "nls.h"
 #include "closestream.h"
 #include "c.h"
-#include "exitcodes.h"
 
 /* Exit codes used by findfs. */
 #define FINDFS_SUCCESS         0       /* no errors */
@@ -33,7 +32,7 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_("Find a filesystem by label or UUID.\n"), out);
 
        fputs(USAGE_OPTIONS, out);
-       print_usage_help_options(16);
+       fprintf(out, USAGE_HELP_OPTIONS(16));
        fprintf(out, USAGE_MAN_TAIL("findfs(8)"));
        exit(FINDFS_SUCCESS);
 }
@@ -51,7 +50,7 @@ int main(int argc, char **argv)
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
-       atexit(close_stdout);
+       close_stdout_atexit();
 
        if (argc != 2) {
                /* we return '2' for backward compatibility
@@ -63,8 +62,7 @@ int main(int argc, char **argv)
        while ((c = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1)
                switch (c) {
                case 'V':
-                       printf(UTIL_LINUX_VERSION);
-                       return FINDFS_SUCCESS;
+                       print_version(FINDFS_SUCCESS);
                case 'h':
                        usage();
                default:
@@ -78,4 +76,3 @@ int main(int argc, char **argv)
        puts(dev);
        return FINDFS_SUCCESS;
 }
-