From: Lars Op den Kamp Date: Mon, 3 Oct 2011 10:52:24 +0000 (+0200) Subject: fixed return value check of m_communication->Write() X-Git-Tag: upstream/2.2.0~1^2~304 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=3fcd38dcd9f704c307da815f39c23f3e0581ef3e;p=deb_libcec.git fixed return value check of m_communication->Write() --- diff --git a/src/lib/CECParser.cpp b/src/lib/CECParser.cpp index 4cbdd6c..1eaa1f5 100644 --- a/src/lib/CECParser.cpp +++ b/src/lib/CECParser.cpp @@ -379,7 +379,7 @@ void CCECParser::BroadcastActiveSource(void) bool CCECParser::TransmitFormatted(const cec_frame &data, bool bWaitForAck /* = true */) { - if (!m_communication || m_communication->Write(data) != data.size()) + if (!m_communication || !m_communication->Write(data)) return false; CCondition::Sleep((int) data.size() * 24 /*data*/ + 5 /*start bit (4.5 ms)*/ + 50 /* to be on the safe side */); @@ -709,7 +709,7 @@ bool CCECParser::SetAckMask(uint16_t iMask) PushEscaped(output, (uint8_t)iMask); output.push_back(MSGEND); - if (m_communication->Write(output) == -1) + if (!m_communication->Write(output)) { AddLog(CEC_LOG_ERROR, "could not set the ackmask"); return false;