diff options
author | Karel Zak | 2019-04-16 15:14:13 +0200 |
---|---|---|
committer | Karel Zak | 2019-04-16 15:14:13 +0200 |
commit | 2c308875a7fa1aaa44892c368f6b37bcfcb8879a (patch) | |
tree | 157ea7afca59059676dbcc25133dd196d1e45fb8 /misc-utils/logger.c | |
parent | include/c: add print_version() macro (diff) | |
download | kernel-qcow2-util-linux-2c308875a7fa1aaa44892c368f6b37bcfcb8879a.tar.gz kernel-qcow2-util-linux-2c308875a7fa1aaa44892c368f6b37bcfcb8879a.tar.xz kernel-qcow2-util-linux-2c308875a7fa1aaa44892c368f6b37bcfcb8879a.zip |
misc: consolidate version printing and close_stdout()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/logger.c')
-rw-r--r-- | misc-utils/logger.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/misc-utils/logger.c b/misc-utils/logger.c index d6cee8287..a99a0c96c 100644 --- a/misc-utils/logger.c +++ b/misc-utils/logger.c @@ -1155,7 +1155,7 @@ int main(int argc, char **argv) setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); - atexit(close_stdout); + close_stdout_atexit(); INIT_LIST_HEAD(&ctl.user_sds); INIT_LIST_HEAD(&ctl.reserved_sds); @@ -1212,11 +1212,6 @@ int main(int argc, char **argv) case 'P': ctl.port = optarg; break; - case 'V': - printf(UTIL_LINUX_VERSION); - exit(EXIT_SUCCESS); - case 'h': - usage(); case OPT_OCTET_COUNT: ctl.octet_count = 1; break; @@ -1263,6 +1258,11 @@ int main(int argc, char **argv) errx(EXIT_FAILURE, _("invalid structured data parameter: '%s'"), optarg); add_structured_data_param(get_user_structured_data(&ctl), optarg); break; + + case 'V': + print_version(EXIT_SUCCESS); + case 'h': + usage(); default: errtryhelp(EXIT_FAILURE); } |