From 8c0d4ecbdc79ee226f4a55bb5a0f954acabe722e Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Sun, 19 Feb 2023 18:01:24 -0300 Subject: extract_seccomp.c: use "do while" in macro definition To match the common usage; see for example src/firejail/firejail.h. Added on commit 960b4daba ("add tool to dump seccomp filters", 2020-02-17). --- src/tools/extract_seccomp.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/tools/extract_seccomp.c b/src/tools/extract_seccomp.c index 0482dfd88..69e20317a 100644 --- a/src/tools/extract_seccomp.c +++ b/src/tools/extract_seccomp.c @@ -31,10 +31,13 @@ #include #define MAXBUF 1024 -#define errExit(msg) { char msgout[256]; \ - snprintf(msgout, 256, "Error %d: %s", __LINE__, (msg)); \ - perror(msgout); \ - exit(1); } +#define errExit(msg) \ + do { \ + char msgout[256]; \ + snprintf(msgout, 256, "Error %d: %s", __LINE__, (msg)); \ + perror(msgout); \ + exit(1); \ + } while (0); // dump all seccomp filters of a process // for further analysis with fsec-print -- cgit v1.2.3-54-g00ecf