aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/common.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/include/common.h b/src/include/common.h
index 5f09fe3e2..61a27ded9 100644
--- a/src/include/common.h
+++ b/src/include/common.h
@@ -39,13 +39,15 @@
39// dbus proxy path used by firejail and firemon 39// dbus proxy path used by firejail and firemon
40#define XDG_DBUS_PROXY_PATH "/usr/bin/xdg-dbus-proxy" 40#define XDG_DBUS_PROXY_PATH "/usr/bin/xdg-dbus-proxy"
41 41
42#define errExit(msg) do { \ 42#define errExit(msg) _errExit(__FILE__, __LINE__, __func__, msg)
43 char msgout[500]; \ 43
44 snprintf(msgout, 500, "Error %s:%d: %s: %s", \ 44static inline void __attribute__((noreturn))
45 __FILE__, __LINE__, __func__, msg); \ 45_errExit(const char *fname, int lineno, const char *func, const char *msg) {
46 perror(msgout); \ 46 char msgout[500];
47 exit(1); \ 47 snprintf(msgout, 500, "Error %s:%d: %s: %s", fname, lineno, func, msg);
48} while (0) 48 perror(msgout);
49 exit(1);
50}
49 51
50// macro to print ip addresses in a printf statement 52// macro to print ip addresses in a printf statement
51#define PRINT_IP(A) \ 53#define PRINT_IP(A) \