From: bert hubert Date: Tue, 1 Dec 2015 09:04:36 +0000 (+0100) Subject: our delaypipe tests sometimes fail, this might at least tell us why. perhaps. X-Git-Tag: dnsdist-1.0.0-alpha1~161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2e9d689c2426544be2f94e4b2c57b301e1b3f6b;p=thirdparty%2Fpdns.git our delaypipe tests sometimes fail, this might at least tell us why. perhaps. --- diff --git a/pdns/delaypipe.cc b/pdns/delaypipe.cc index b2a4e5a2e6..333a08ea5e 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;