aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/common.h
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-07-01 17:35:02 +0000
committerLibravatar GitHub <noreply@github.com>2023-07-01 17:35:02 +0000
commit33c75b89328df03ef3245c7ec6f30759f9619223 (patch)
tree9e220cbf063e5e5b42015571f71a26529471e76e /src/include/common.h
parentfirecfg.config: actually fix sorting (diff)
parentImprove errExit error messages (diff)
downloadfirejail-33c75b89328df03ef3245c7ec6f30759f9619223.tar.gz
firejail-33c75b89328df03ef3245c7ec6f30759f9619223.tar.zst
firejail-33c75b89328df03ef3245c7ec6f30759f9619223.zip
Merge pull request #5871 from kmk3/improve-errexit
modif: improve errExit error messages
Diffstat (limited to 'src/include/common.h')
-rw-r--r--src/include/common.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/include/common.h b/src/include/common.h
index a0ad8c765..4a2b8c1bf 100644
--- a/src/include/common.h
+++ b/src/include/common.h
@@ -32,11 +32,20 @@
32#include <ctype.h> 32#include <ctype.h>
33#include <assert.h> 33#include <assert.h>
34 34
35#if !defined(__func__) && defined(__FUNCTION__)
36#define __func__ __FUNCTION__
37#endif
38
35// dbus proxy path used by firejail and firemon 39// dbus proxy path used by firejail and firemon
36#define XDG_DBUS_PROXY_PATH "/usr/bin/xdg-dbus-proxy" 40#define XDG_DBUS_PROXY_PATH "/usr/bin/xdg-dbus-proxy"
37 41
38 42#define errExit(msg) do { \
39#define errExit(msg) do { char msgout[500]; snprintf(msgout, 500, "Error %s: %s:%d %s", msg, __FILE__, __LINE__, __FUNCTION__); perror(msgout); exit(1);} while (0) 43 char msgout[500]; \
44 snprintf(msgout, 500, "Error %s/%s:%d %s(): %s", \
45 MOD_DIR, __FILE__, __LINE__, __func__, msg); \
46 perror(msgout); \
47 exit(1); \
48} while (0)
40 49
41// macro to print ip addresses in a printf statement 50// macro to print ip addresses in a printf statement
42#define PRINT_IP(A) \ 51#define PRINT_IP(A) \