repositories
/
deb_libcec.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c7e9549
)
cec: check whether m_port isn't NULL in ReadFromDevice
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Tue, 4 Oct 2011 18:59:47 +0000
(20:59 +0200)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Tue, 4 Oct 2011 18:59:47 +0000
(20:59 +0200)
src/lib/AdapterCommunication.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/lib/AdapterCommunication.cpp
b/src/lib/AdapterCommunication.cpp
index be9485824be8e2f7dd30f6c29047428a8f370f2d..d56ee168b642df7d2ab173677569c0271222ecdb 100644
(file)
--- a/
src/lib/AdapterCommunication.cpp
+++ b/
src/lib/AdapterCommunication.cpp
@@
-116,8
+116,6
@@
void *CAdapterCommunication::Process(void)
CCondition::Sleep(50);
}
- m_controller->AddLog(CEC_LOG_DEBUG, "reader thread terminated");
-
CLockObject lock(&m_commMutex);
m_bStarted = false;
return NULL;
@@
-127,6
+125,9
@@
bool CAdapterCommunication::ReadFromDevice(int iTimeout)
{
uint8_t buff[1024];
CLockObject lock(&m_commMutex);
+ if (!m_port)
+ return false;
+
int iBytesRead = m_port->Read(buff, sizeof(buff), iTimeout);
lock.Leave();
if (iBytesRead < 0)