From a9f04c33e5370755f36e9e85250c6ab997f94004 Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Tue, 21 Feb 2023 13:16:59 +0100 Subject: actions: add data section --- actions.c | 2 +- actions.h | 2 +- tests/unit/test_actions.c | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/actions.c b/actions.c index 0366916..8e740e0 100644 --- a/actions.c +++ b/actions.c @@ -164,7 +164,7 @@ int do_call(struct arg_clone *c) return 0; } -int do_actions(struct action actions[], unsigned int n_actions, int pid, +int do_actions(void *data, struct action actions[], unsigned int n_actions, int pid, int notifyfd, uint64_t id) { struct seccomp_notif_addfd resp_fd; diff --git a/actions.h b/actions.h index 3636f04..521bdaf 100644 --- a/actions.h +++ b/actions.h @@ -14,7 +14,7 @@ struct arg_clone { }; int do_call(struct arg_clone *c); -int do_actions(struct action actions[], unsigned int n_actions, int tpid, +int do_actions(void *data, struct action actions[], unsigned int n_actions, int tpid, int notifyfd, uint64_t id); #endif /* ACTIONS_H */ diff --git a/tests/unit/test_actions.c b/tests/unit/test_actions.c index 99799e5..9e1480f 100644 --- a/tests/unit/test_actions.c +++ b/tests/unit/test_actions.c @@ -209,7 +209,7 @@ START_TEST(test_act_continue) struct action actions[] = { { .type = A_CONT }, }; - int ret = do_actions(actions, sizeof(actions) / sizeof(actions[0]), -1, + int ret = do_actions(NULL, actions, sizeof(actions) / sizeof(actions[0]), -1, notifyfd, req.id); ck_assert_msg(ret == 0, strerror(errno)); ck_assert_int_eq(at->err, 0); @@ -224,7 +224,7 @@ START_TEST(test_act_block) .block = { .error = -1 }, }, }; - int ret = do_actions(actions, sizeof(actions) / sizeof(actions[0]), -1, + int ret = do_actions(NULL, actions, sizeof(actions) / sizeof(actions[0]), -1, notifyfd, req.id); ck_assert_msg(ret == 0, strerror(errno)); check_target_result(-1, 0); @@ -239,7 +239,7 @@ START_TEST(test_act_return) .ret = { .type = IMMEDIATE, .value = 1 }, }, }; - int ret = do_actions(actions, sizeof(actions) / sizeof(actions[0]), -1, + int ret = do_actions(NULL, actions, sizeof(actions) / sizeof(actions[0]), -1, notifyfd, req.id); ck_assert_msg(ret == 0, strerror(errno)); check_target_result(1, 0); @@ -255,7 +255,7 @@ START_TEST(test_act_return_ref) .ret = { .type = REFERENCE, .value_p = &v }, }, }; - int ret = do_actions(actions, sizeof(actions) / sizeof(actions[0]), -1, + int ret = do_actions(NULL, actions, sizeof(actions) / sizeof(actions[0]), -1, notifyfd, req.id); ck_assert_msg(ret == 0, strerror(errno)); check_target_result(v, 0); @@ -270,7 +270,7 @@ START_TEST(test_act_return_empty_ref) .ret = { .type = REFERENCE, .value_p = NULL }, }, }; - int ret = do_actions(actions, sizeof(actions) / sizeof(actions[0]), -1, + int ret = do_actions(NULL, actions, sizeof(actions) / sizeof(actions[0]), -1, notifyfd, req.id); ck_assert_int_eq(ret, -1); } @@ -287,7 +287,7 @@ static void test_inject(struct action actions[], int n) actions[0].inj.newfd = fd_inj; actions[0].inj.oldfd = test_fd; - ret = do_actions(actions, n, -1, notifyfd, req.id); + ret = do_actions(NULL, actions, n, -1, notifyfd, req.id); ck_assert_msg(ret == 0, strerror(errno)); check_target_fd(pid, test_fd); } -- cgit v1.2.3