summaryrefslogtreecommitdiffstats
path: root/kmobile
diff options
context:
space:
mode:
Diffstat (limited to 'kmobile')
-rw-r--r--kmobile/kmobiledevice.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/kmobile/kmobiledevice.cpp b/kmobile/kmobiledevice.cpp
index abf75057..72394647 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
}