]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix maybe-unitialized warning while improving the test to use the return value 7337/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 7 Jan 2019 08:42:55 +0000 (09:42 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 7 Jan 2019 08:42:55 +0000 (09:42 +0100)
of waitEvent.

Beter fix than the one proposed in #6675

pdns/recursordist/test-mtasker.cc

index f6f1b5b46549c83d062ea72c71cb7dd7bf61a74c..e022a19f7b96787271c00bc09599a8d8628a73f1 100644 (file)
@@ -16,9 +16,8 @@ static void doSomething(void* p)
 {
   MTasker<>* mt = reinterpret_cast<MTasker<>*>(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) {