From ff14fdb62f2a90645b61731118caaf9af816b6bb Mon Sep 17 00:00:00 2001 From: Aomx <julian.cordes@gmail.com> Date: Fri, 25 Sep 2015 13:41:37 +0200 Subject: [PATCH] added now result_check_t CHECK_ANY, that accepts every return value from a system call. --- gtests/net/packetdrill/run_system_call.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gtests/net/packetdrill/run_system_call.c b/gtests/net/packetdrill/run_system_call.c index 339459ec..2ec0c768 100644 --- a/gtests/net/packetdrill/run_system_call.c +++ b/gtests/net/packetdrill/run_system_call.c @@ -514,6 +514,7 @@ static void begin_syscall(struct state *state, struct syscall_spec *syscall) enum result_check_t { CHECK_EXACT, /* check that result matches exactly */ CHECK_NON_NEGATIVE, /* check that result is non-negative */ + CHECK_ANY, /* accept any result */ }; static int end_syscall(struct state *state, struct syscall_spec *syscall, enum result_check_t mode, int actual, char **error) @@ -557,7 +558,9 @@ static int end_syscall(struct state *state, struct syscall_spec *syscall, expected, actual); return STATUS_ERR; } - } else { + } else if (mode == CHECK_ANY) { + return STATUS_OK; + }else { assert(!"bad mode"); } @@ -994,7 +997,7 @@ static int syscall_accept(struct state *state, struct syscall_spec *syscall, result = accept(live_fd, (struct sockaddr *)&live_addr, &live_addrlen); - if (end_syscall(state, syscall, CHECK_EXACT, result, error)) + if (end_syscall(state, syscall, CHECK_ANY, result, error)) return STATUS_ERR; if (result >= 0) { -- GitLab