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 --- text-utils/more.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'text-utils/more.c') diff --git a/text-utils/more.c b/text-utils/more.c index 8d394bc30..6e1ca569c 100644 --- a/text-utils/more.c +++ b/text-utils/more.c @@ -275,7 +275,7 @@ static void arg_parser(struct more_control *ctl, char *s) case '\t': break; case 'V': - printf(UTIL_LINUX_VERSION); + print_version(EXIT_SUCCESS); exit(EXIT_SUCCESS); break; default: @@ -1920,16 +1920,14 @@ int main(int argc, char **argv) setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); - atexit(close_stdout); + close_stdout_atexit(); if (argc > 1) { /* first arg may be one of our standard longopts */ if (!strcmp(argv[1], "--help")) usage(); - if (!strcmp(argv[1], "--version")) { - printf(UTIL_LINUX_VERSION); - exit(EXIT_SUCCESS); - } + if (!strcmp(argv[1], "--version")) + print_version(EXIT_SUCCESS); } ctl.num_files = argc; -- cgit v1.2.3-55-g7522