summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKarel Zak2016-12-19 11:33:40 +0100
committerKarel Zak2016-12-19 11:33:40 +0100
commit3077b37101c0c7b89368eafb043adc95eb8db45c (patch)
treed2659273f497e8c9623cd00f96866b2d060c8fbb /include
parentdocs: replace FTP by HTTPS in kernel.org URLs (diff)
downloadkernel-qcow2-util-linux-3077b37101c0c7b89368eafb043adc95eb8db45c.tar.gz
kernel-qcow2-util-linux-3077b37101c0c7b89368eafb043adc95eb8db45c.tar.xz
kernel-qcow2-util-linux-3077b37101c0c7b89368eafb043adc95eb8db45c.zip
include/c.h: add errtryhelp()
Add code to print: Try '<progname> --help' for more information. and exit. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/c.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/c.h b/include/c.h
index 08dab934a..bf11d61ac 100644
--- a/include/c.h
+++ b/include/c.h
@@ -204,6 +204,15 @@ errmsg(char doexit, int excode, char adderr, const char *fmt, ...)
#endif /* !HAVE_ERR_H */
+/* Don't use inline function to avoid '#include "nls.h"' in c.h
+ */
+#define errtryhelp(eval) __extension__ ({ \
+ fprintf(stderr, _("Try '%s --help' for more information.\n"), \
+ program_invocation_short_name); \
+ exit(eval); \
+})
+
+
static inline __attribute__((const)) int is_power_of_2(unsigned long num)
{
return (num != 0 && ((num & (num - 1)) == 0));