From 68224d108d1e5359a111cb2be0404f6556cb90dd Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 16 Apr 2019 13:47:17 +0200 Subject: 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 --- sys-utils/mount.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys-utils/mount.c') 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"); -- cgit v1.2.3-55-g7522