From 2c308875a7fa1aaa44892c368f6b37bcfcb8879a Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 16 Apr 2019 15:14:13 +0200 Subject: misc: consolidate version printing and close_stdout() Signed-off-by: Karel Zak --- misc-utils/wipefs.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'misc-utils/wipefs.c') diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c index 13a720e85..78e5ac376 100644 --- a/misc-utils/wipefs.c +++ b/misc-utils/wipefs.c @@ -700,7 +700,7 @@ main(int argc, char **argv) setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); - atexit(close_stdout); + close_stdout_atexit(); while ((c = getopt_long(argc, argv, "abfhiJnO:o:pqt:V", longopts, NULL)) != -1) { @@ -716,9 +716,6 @@ main(int argc, char **argv) case 'f': ctl.force = 1; break; - case 'h': - usage(); - break; case 'J': ctl.json = 1; break; @@ -745,9 +742,11 @@ main(int argc, char **argv) case 't': ctl.type_pattern = optarg; break; + + case 'h': + usage(); case 'V': - printf(UTIL_LINUX_VERSION); - return EXIT_SUCCESS; + print_version(EXIT_SUCCESS); default: errtryhelp(EXIT_FAILURE); } -- cgit v1.2.3-55-g7522