diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2023-02-19 18:01:24 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2023-02-20 17:39:31 -0300 |
commit | 8c0d4ecbdc79ee226f4a55bb5a0f954acabe722e (patch) | |
tree | 806b9aa30d5f8756a3a99f51971c2ddb21f09892 /src/tools | |
parent | test/filters/namespaces.c: use tabs for indentation (diff) | |
download | firejail-8c0d4ecbdc79ee226f4a55bb5a0f954acabe722e.tar.gz firejail-8c0d4ecbdc79ee226f4a55bb5a0f954acabe722e.tar.zst firejail-8c0d4ecbdc79ee226f4a55bb5a0f954acabe722e.zip |
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).
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/extract_seccomp.c | 11 |
1 files 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 @@ | |||
31 | #include <linux/filter.h> | 31 | #include <linux/filter.h> |
32 | 32 | ||
33 | #define MAXBUF 1024 | 33 | #define MAXBUF 1024 |
34 | #define errExit(msg) { char msgout[256]; \ | 34 | #define errExit(msg) \ |
35 | snprintf(msgout, 256, "Error %d: %s", __LINE__, (msg)); \ | 35 | do { \ |
36 | perror(msgout); \ | 36 | char msgout[256]; \ |
37 | exit(1); } | 37 | snprintf(msgout, 256, "Error %d: %s", __LINE__, (msg)); \ |
38 | perror(msgout); \ | ||
39 | exit(1); \ | ||
40 | } while (0); | ||
38 | 41 | ||
39 | // dump all seccomp filters of a process | 42 | // dump all seccomp filters of a process |
40 | // for further analysis with fsec-print | 43 | // for further analysis with fsec-print |