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 /disk-utils/fsck.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 'disk-utils/fsck.c')
-rw-r--r-- | disk-utils/fsck.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/disk-utils/fsck.c b/disk-utils/fsck.c index 3afc88600..be25f9c95 100644 --- a/disk-utils/fsck.c +++ b/disk-utils/fsck.c @@ -1450,10 +1450,8 @@ static void parse_argv(int argc, char *argv[]) /* the only two longopts to satisfy UL standards */ if (!opts_for_fsck && !strcmp(arg, "--help")) usage(); - if (!opts_for_fsck && !strcmp(arg, "--version")) { - printf(UTIL_LINUX_VERSION); - exit(FSCK_EX_OK); - } + if (!opts_for_fsck && !strcmp(arg, "--version")) + print_version(FSCK_EX_OK); if ((arg[0] == '/' && !opts_for_fsck) || strchr(arg, '=')) { if (num_devices >= MAX_DEVICES) @@ -1621,7 +1619,7 @@ int main(int argc, char *argv[]) setlocale(LC_CTYPE, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); - atexit(close_stdout); + close_stdout_atexit(); strutils_set_exitcode(FSCK_EX_USAGE); mnt_init_debug(0); /* init libmount debug mask */ |