From c2e9d689c2426544be2f94e4b2c57b301e1b3f6b Mon Sep 17 00:00:00 2001 From: bert hubert Date: Tue, 1 Dec 2015 10:04:36 +0100 Subject: [PATCH] our delaypipe tests sometimes fail, this might at least tell us why. perhaps. --- pdns/delaypipe.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pdns/delaypipe.cc b/pdns/delaypipe.cc index b2a4e5a2e..333a08ea5 100644 --- a/pdns/delaypipe.cc +++ b/pdns/delaypipe.cc @@ -44,6 +44,8 @@ bool ObjectPipe::read(T* t) unixDie("read"); if(ret==0) return false; + if(ret != sizeof(ptr)) + throw std::runtime_error("Partial read, should not happen"); *t=*ptr; delete ptr; return true; @@ -66,6 +68,8 @@ int ObjectPipe::readTimeout(T* t, double msec) unixDie("read"); if(ret==0) return false; + if(ret != sizeof(ptr)) + throw std::runtime_error("Partial read, should not happen 2"); *t=*ptr; delete ptr; return 1; -- 2.40.0