From 3f59f818b44b36ca41d870eb2f60431282573047 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 8 Jan 2008 13:08:32 +0100 Subject: [PATCH] mount: add more details to the --version output Signed-off-by: Karel Zak --- mount/mount.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/mount/mount.c b/mount/mount.c index 0688c57f..41fe71d6 100644 --- a/mount/mount.c +++ b/mount/mount.c @@ -1819,6 +1819,22 @@ getfs(const char *spec, const char *uuid, const char *label) return mc; } + +static void +print_version(int rc) { + printf( "mount from %s (with " +#ifdef HAVE_LIBBLKID + "libblkid" +#else + "libvolume_id" +#endif +#ifdef HAVE_LIBSELINUX + " and selinux" +#endif + " support)\n", PACKAGE_STRING); + exit(rc); +} + int main(int argc, char *argv[]) { int c, result = 0, specseen; @@ -1908,8 +1924,8 @@ main(int argc, char *argv[]) { ++verbose; break; case 'V': /* version */ - printf ("mount (%s)\n", PACKAGE_STRING); - exit (0); + print_version(EXIT_SUCCESS); + break; case 'w': /* mount read/write */ readwrite = 1; readonly = 0; -- 2.39.5