From 105df0826eca906593e73a0a6333e3c867067ed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Thu, 29 Sep 2016 02:31:41 +0200 Subject: Fix missing return in KMobileDevice::unlockDevice This resolves bug 2692 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- kmobile/kmobiledevice.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'kmobile') 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 } -- cgit v1.2.3