summaryrefslogtreecommitdiff
path: root/src/test/test-bpf.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-03-09 21:55:55 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-03-11 16:33:57 +0100
commitc70cac548aab08b9d9a20fec48afc4a4c86c7672 (patch)
tree62395c54a7446e51c690d35dc91b13939fa662d1 /src/test/test-bpf.c
parent9aa2e409bcb70f3952b38a35f16fc080c22dd5a5 (diff)
downloadsystemd-c70cac548aab08b9d9a20fec48afc4a4c86c7672.tar.gz
Introduce _cleanup_(manager_freep)
Diffstat (limited to 'src/test/test-bpf.c')
-rw-r--r--src/test/test-bpf.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/test/test-bpf.c b/src/test/test-bpf.c
index 6ca2be41b0..afbc41cf43 100644
--- a/src/test/test-bpf.c
+++ b/src/test/test-bpf.c
@@ -41,7 +41,7 @@ int main(int argc, char *argv[]) {
_cleanup_(rm_rf_physical_and_freep) char *runtime_dir = NULL;
CGroupContext *cc = NULL;
_cleanup_(bpf_program_unrefp) BPFProgram *p = NULL;
- Manager *m = NULL;
+ _cleanup_(manager_freep) Manager *m = NULL;
Unit *u;
char log_buf[65535];
int r;
@@ -128,11 +128,9 @@ int main(int argc, char *argv[]) {
unit_dump(u, stdout, NULL);
r = bpf_firewall_compile(u);
- if (IN_SET(r, -ENOTTY, -ENOSYS, -EPERM )) {
+ if (IN_SET(r, -ENOTTY, -ENOSYS, -EPERM ))
/* Kernel doesn't support the necessary bpf bits, or masked out via seccomp? */
- manager_free(m);
return EXIT_TEST_SKIP;
- }
assert_se(r >= 0);
assert(u->ip_bpf_ingress);
@@ -167,7 +165,5 @@ int main(int argc, char *argv[]) {
assert_se(SERVICE(u)->exec_command[SERVICE_EXEC_START]->command_next->exec_status.code != CLD_EXITED ||
SERVICE(u)->exec_command[SERVICE_EXEC_START]->command_next->exec_status.status != EXIT_SUCCESS);
- manager_free(m);
-
return 0;
}