Commit 049baec5 introduced a small bug in the logic checking
return value of virStreamRecv*. Change the logic to only croak
when return value is < 0 and not equal to -2 or -3.
---
Changes | 2 +-
Virt.xs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Changes b/Changes
index 3763b1d..96b42f8 100644
--- a/Changes
+++ b/Changes
@@ -2,7 +2,7 @@ Revision history for perl module Sys::Virt
4.0.0 2018-00-00
- - XXX
+ - Fix check of return value from virStreamRecv*
3.9.1 2017-12-05
diff --git a/Virt.xs b/Virt.xs
index 415eb8a..c47b915 100644
--- a/Virt.xs
+++ b/Virt.xs
@@ -8074,7 +8074,7 @@ recv(st, data, nbytes, flags=0)
else
RETVAL = virStreamRecv(st, rawdata, nbytes);
- if (RETVAL != -2 && RETVAL != -3) {
+ if ((RETVAL < 0) && (RETVAL != -2 || RETVAL != -3)) {
Safefree(rawdata);
_croak_error();
}
--
2.15.1