summaryrefslogtreecommitdiffstats
path: root/sys-utils/mount.c
diff options
context:
space:
mode:
authorKarel Zak2019-04-16 13:47:17 +0200
committerKarel Zak2019-04-16 13:47:17 +0200
commit68224d108d1e5359a111cb2be0404f6556cb90dd (patch)
tree4d956d4d580dd6ceac9e7a23469a914780d115ac /sys-utils/mount.c
parentinclude/closestream: add close_stdout_atexit() (diff)
downloadkernel-qcow2-util-linux-68224d108d1e5359a111cb2be0404f6556cb90dd.tar.gz
kernel-qcow2-util-linux-68224d108d1e5359a111cb2be0404f6556cb90dd.tar.xz
kernel-qcow2-util-linux-68224d108d1e5359a111cb2be0404f6556cb90dd.zip
include/c: add print_version() macro
Let's consolidate the version printing code. It also seems better to use exit() after --version, because it's handled in different way by ASAN. It's strange, but ASAN reports leaks after return in main(). Note that we do not use free-before-exit. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/mount.c')
-rw-r--r--sys-utils/mount.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys-utils/mount.c b/sys-utils/mount.c
index b91d4779a..b1b43251e 100644
--- a/sys-utils/mount.c
+++ b/sys-utils/mount.c
@@ -73,7 +73,7 @@ static void __attribute__((__noreturn__)) exit_non_root(const char *option)
errx(MNT_EX_USAGE, _("only root can do that"));
}
-static void __attribute__((__noreturn__)) print_version(void)
+static void __attribute__((__noreturn__)) mount_print_version(void)
{
const char *ver = NULL;
const char **features = NULL, **p;
@@ -708,7 +708,7 @@ int main(int argc, char **argv)
mnt_context_enable_verbose(cxt, TRUE);
break;
case 'V':
- print_version();
+ mount_print_version();
break;
case 'w':
append_option(cxt, "rw");