summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls
diff options
context:
space:
mode:
authorAdam Barth <abarth@google.com>2021-06-03 09:42:42 -0700
committergVisor bot <gvisor-bot@google.com>2021-06-03 09:47:24 -0700
commitddcd17399b1c1083a132772702d516c154815680 (patch)
tree0d6e1fefdbdaabd9fccbb46bf765cd51eaf079fa /test/syscalls
parent9357b4f7eb51b78311cb7d6478d5ac3bfcf79948 (diff)
Reset global_num_signals_received on RegisterSignalHandler
Previously, the value of global_num_signals_received would persist between tests. Now, we reset the value to zero when we register a signal handler. PiperOrigin-RevId: 377308357
Diffstat (limited to 'test/syscalls')
-rw-r--r--test/syscalls/linux/pipe.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/syscalls/linux/pipe.cc b/test/syscalls/linux/pipe.cc
index 294a72468..0bba86846 100644
--- a/test/syscalls/linux/pipe.cc
+++ b/test/syscalls/linux/pipe.cc
@@ -53,6 +53,7 @@ void SigRecordingHandler(int signum, siginfo_t* siginfo,
}
PosixErrorOr<Cleanup> RegisterSignalHandler(int signum) {
+ global_num_signals_received = 0;
struct sigaction handler;
handler.sa_sigaction = SigRecordingHandler;
sigemptyset(&handler.sa_mask);