summaryrefslogtreecommitdiffstats
path: root/sys-utils/losetup.c
diff options
context:
space:
mode:
authorKarel Zak2019-04-16 15:14:13 +0200
committerKarel Zak2019-04-16 15:14:13 +0200
commit2c308875a7fa1aaa44892c368f6b37bcfcb8879a (patch)
tree157ea7afca59059676dbcc25133dd196d1e45fb8 /sys-utils/losetup.c
parentinclude/c: add print_version() macro (diff)
downloadkernel-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 'sys-utils/losetup.c')
-rw-r--r--sys-utils/losetup.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c
index 3dbbcdd3e..d862fd8e7 100644
--- a/sys-utils/losetup.c
+++ b/sys-utils/losetup.c
@@ -683,9 +683,6 @@ int main(int argc, char **argv)
case 'f':
act = A_FIND_FREE;
break;
- case 'h':
- usage();
- break;
case 'J':
json = 1;
break;
@@ -730,13 +727,15 @@ int main(int argc, char **argv)
break;
case 'v':
break;
- case 'V':
- printf(UTIL_LINUX_VERSION);
- return EXIT_SUCCESS;
case OPT_SIZELIMIT: /* --sizelimit */
sizelimit = strtosize_or_err(optarg, _("failed to parse size"));
flags |= LOOPDEV_FL_SIZELIMIT;
break;
+
+ case 'h':
+ usage();
+ case 'V':
+ print_version(EXIT_SUCCESS);
default:
errtryhelp(EXIT_FAILURE);
}