From 3ee990b14ec461b0581888a038248f603a0d8113 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 13 Jun 2013 15:21:42 -0700 Subject: [PATCH] PR15619: Check prior stapdyn signals while waiting to exit * stapdyn/mutator.cxx (mutator::run): When running without mutatees (which is really only done by the testsuite), use a proper signal mask and check for signals that may have already arrived. --- stapdyn/mutator.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stapdyn/mutator.cxx b/stapdyn/mutator.cxx index 6ee296284..5fa0c5890 100644 --- a/stapdyn/mutator.cxx +++ b/stapdyn/mutator.cxx @@ -596,8 +596,9 @@ mutator::run () else // !target_mutatee { // With no mutatees, we just wait for a signal to exit. - int signal; - sigwait(g_signal_mask, &signal); + stap_sigmasker masked(g_signal_mask); + while (sigisemptyset(&signals_received)) + sigsuspend(&masked.old); } // Indicate failure if the target had anything but EXIT_SUCCESS -- 2.43.5