From: Justin Cinkelj <[email protected]>
Committer: Nadav Har'El <[email protected]>
Branch: master

tests/tst-kill: set flag global to 0 before waiting for 1

The global was already set to 1 by kill above second wait loop.
If test VM/program was "slow" enough, the signal handler got cleaned
before "oldact.sa_handler == SIG_DFL" check (debug build, nested VM,
slow enough report printout). The test tended to fail when VM run on
physical host.

Fixes #861
Message-Id: <[email protected]>

---
diff --git a/tests/tst-kill.cc b/tests/tst-kill.cc
--- a/tests/tst-kill.cc
+++ b/tests/tst-kill.cc
@@ -130,6 +130,7 @@ int main(int ac, char** av)
     r = sigaction(SIGUSR1, nullptr, &oldact);
report(r == 0 && oldact.sa_handler == handler1, "without SA_RESETHAND, signal handler is not reset");
     act.sa_flags = SA_RESETHAND;
+    global = 0;
     r = sigaction(SIGUSR1, &act, nullptr);
     report(r == 0, "set SIGUSR1 handler with SA_RESETHAND");
     r = kill(0, SIGUSR1);

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to