Merge "Change the CHECK failure into function failure." into oc-dev am: bf6e949727
am: 4847c7f708
Change-Id: Iea6c547dc36ab3910f4100d0dbf60a56201a0107
diff --git a/libappfuse/FuseBuffer.cc b/libappfuse/FuseBuffer.cc
index fd69849..653e96b 100644
--- a/libappfuse/FuseBuffer.cc
+++ b/libappfuse/FuseBuffer.cc
@@ -119,7 +119,12 @@
return ResultOrAgain::kFailure;
}
}
- CHECK(static_cast<uint32_t>(result) == header.len);
+
+ if (static_cast<unsigned int>(result) != header.len) {
+ LOG(ERROR) << "Written bytes " << result << " is different from length in header "
+ << header.len;
+ return ResultOrAgain::kFailure;
+ }
return ResultOrAgain::kSuccess;
}
}