summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKarel Zak2019-04-16 15:14:13 +0200
committerKarel Zak2019-04-16 15:14:13 +0200
commit2c308875a7fa1aaa44892c368f6b37bcfcb8879a (patch)
tree157ea7afca59059676dbcc25133dd196d1e45fb8 /include
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 'include')
-rw-r--r--include/c.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/c.h b/include/c.h
index fb6835253..fc69b910b 100644
--- a/include/c.h
+++ b/include/c.h
@@ -351,6 +351,11 @@ static inline int xusleep(useconds_t usec)
#define UTIL_LINUX_VERSION _("%s from %s\n"), program_invocation_short_name, PACKAGE_STRING
+#define print_version(eval) __extension__ ({ \
+ printf(UTIL_LINUX_VERSION); \
+ exit(eval); \
+})
+
/*
* scanf modifiers for "strings allocation"
*/