diff --git a/src/include/common.h b/src/include/common.h index 5f09fe3e250..61a27ded9d9 100644 --- a/src/include/common.h +++ b/src/include/common.h @@ -39,13 +39,15 @@ // dbus proxy path used by firejail and firemon #define XDG_DBUS_PROXY_PATH "/usr/bin/xdg-dbus-proxy" -#define errExit(msg) do { \ - char msgout[500]; \ - snprintf(msgout, 500, "Error %s:%d: %s: %s", \ - __FILE__, __LINE__, __func__, msg); \ - perror(msgout); \ - exit(1); \ -} while (0) +#define errExit(msg) _errExit(__FILE__, __LINE__, __func__, msg) + +static inline void __attribute__((noreturn)) +_errExit(const char *fname, int lineno, const char *func, const char *msg) { + char msgout[500]; + snprintf(msgout, 500, "Error %s:%d: %s: %s", fname, lineno, func, msg); + perror(msgout); + exit(1); +} // macro to print ip addresses in a printf statement #define PRINT_IP(A) \