Skip to content

Commit

Permalink
selftests: bpf: test_progs: initialize duration in singal_pending test
Browse files Browse the repository at this point in the history
CHECK macro implicitly uses duration. We call CHECK() a couple of times
before duration is initialized from bpf_prog_test_run().
Explicitly set duration to 0 to avoid compiler warnings.

Fixes: 740f8a6 ("selftests/bpf: make sure signal interrupts BPF_PROG_TEST_RUN")
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
fomichev authored and borkmann committed Mar 7, 2019
1 parent 8e26888 commit 69b0917
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/bpf/prog_tests/signal_pending.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ static void test_signal_pending_by_type(enum bpf_prog_type prog_type)
struct itimerval timeo = {
.it_value.tv_usec = 100000, /* 100ms */
};
__u32 duration, retval;
__u32 duration = 0, retval;
int prog_fd;
int err;
int i;
Expand Down

0 comments on commit 69b0917

Please sign in to comment.