From: Otto Moerbeek Date: Mon, 7 Jan 2019 08:42:55 +0000 (+0100) Subject: Fix maybe-unitialized warning while improving the test to use the return value X-Git-Tag: rec-4.2.0-alpha1~63^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F7337%2Fhead;p=thirdparty%2Fpdns.git Fix maybe-unitialized warning while improving the test to use the return value of waitEvent. Beter fix than the one proposed in #6675 --- diff --git a/pdns/recursordist/test-mtasker.cc b/pdns/recursordist/test-mtasker.cc index f6f1b5b465..e022a19f7b 100644 --- a/pdns/recursordist/test-mtasker.cc +++ b/pdns/recursordist/test-mtasker.cc @@ -16,9 +16,8 @@ static void doSomething(void* p) { MTasker<>* mt = reinterpret_cast*>(p); int i=12, o; - mt->waitEvent(i, &o); - g_result = o; - + if (mt->waitEvent(i, &o) == 1) + g_result = o; } BOOST_AUTO_TEST_CASE(test_Simple) {