summaryrefslogtreecommitdiff
path: root/src/MTS_IO_SerialConnection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/MTS_IO_SerialConnection.cpp')
-rw-r--r--src/MTS_IO_SerialConnection.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/MTS_IO_SerialConnection.cpp b/src/MTS_IO_SerialConnection.cpp
index 936d28d..d13c565 100644
--- a/src/MTS_IO_SerialConnection.cpp
+++ b/src/MTS_IO_SerialConnection.cpp
@@ -546,6 +546,10 @@ int SerialConnection::doRead(char* pBuffer, const uint32_t& iSize, int32_t& time
} else {
if (FD_ISSET(h, &readfs)) {
result = ::read(h, pBuffer, iSize);
+ if (result == 0) {
+ printTrace("SERIAL| serial port [%s] disconnected", m_sPortName.c_str());
+ result = -1;
+ }
} else {
//socket closed?
result = -1;