diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2018-06-20 10:14:41 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2018-06-20 10:14:41 +0200 |
commit | 8ea740f3cc872b2585a4ecf97a29127aa9316137 (patch) | |
tree | d6ab5e1608a7a9f3171936d2c59135082c9149a1 /device.cc | |
parent | 5910ec72e0f7abd3f6c876e04a07057b0dd8edaa (diff) | |
download | libnitrokey-8ea740f3cc872b2585a4ecf97a29127aa9316137.tar.gz libnitrokey-8ea740f3cc872b2585a4ecf97a29127aa9316137.tar.bz2 |
Fix log warning regarding repeated disconnection
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'device.cc')
-rw-r--r-- | device.cc | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -69,8 +69,10 @@ bool Device::_disconnect() { LOG(std::string(__FUNCTION__) + std::string(m_model == DeviceModel::PRO ? "PRO" : "STORAGE"), Loglevel::DEBUG_L2); LOG(std::string(__FUNCTION__) + std::string(" *IN* "), Loglevel::DEBUG_L2); - LOG(std::string("Disconnection: handle already freed: ") + std::to_string(mp_devhandle == nullptr) + " ("+m_path+")", Loglevel::DEBUG_L1); - if(mp_devhandle == nullptr) return false; + if(mp_devhandle == nullptr) { + LOG(std::string("Disconnection: handle already freed: ") + std::to_string(mp_devhandle == nullptr) + " ("+m_path+")", Loglevel::DEBUG_L1); + return false; + } hid_close(mp_devhandle); mp_devhandle = nullptr; |