summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2016-09-29 02:31:41 +0200
committerSlávek Banko <slavek.banko@axis.cz>2016-09-29 02:31:51 +0200
commitd465e287d10b6ff3f8ca56b84c82605dd6cc2661 (patch)
tree462c2dcd3361f6cd5cccb56b034b4c10b3468778
parent2ea5a6376f1445fc9e8daf5696e6fa5b74dbc1ac (diff)
downloadtdepim-d465e287d10b6ff3f8ca56b84c82605dd6cc2661.tar.gz
tdepim-d465e287d10b6ff3f8ca56b84c82605dd6cc2661.zip
Fix missing return in KMobileDevice::unlockDevice
This resolves bug 2692 Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 105df0826eca906593e73a0a6333e3c867067ed2)
-rw-r--r--kmobile/kmobiledevice.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/kmobile/kmobiledevice.cpp b/kmobile/kmobiledevice.cpp
index abf750579..723946477 100644
--- a/kmobile/kmobiledevice.cpp
+++ b/kmobile/kmobiledevice.cpp
@@ -382,12 +382,14 @@ bool KMobileDevice::unlockDevice(const TQString &device)
#ifdef HAVE_BAUDBOY_H
return ttyunlock(device.local8bit()) == EXIT_SUCCESS;
#else
- if (m_fd != -1)
- {
- flock(m_fd, LOCK_UN);
+ if (m_fd != -1) {
+ if(flock(m_fd, LOCK_UN)) {
+ return false;
}
- close(m_fd);
+ close(m_fd);
+ }
m_fd = -1;
+ return true;
#endif
}