diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2018-06-20 10:17:30 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2018-06-20 10:17:30 +0200 |
commit | ee6c9c61b93fae7e041abb19e42134d3a831a846 (patch) | |
tree | e411acfde373704febf61e4a2662b7ae77f8e2fd /device.cc | |
parent | e1ef8d79809190c5ac5d540bd4aa376dcfda7e93 (diff) | |
parent | a71507ba0ca4643201c4ceb3d4dfc0f6dd5ae770 (diff) | |
download | libnitrokey-ee6c9c61b93fae7e041abb19e42134d3a831a846.tar.gz libnitrokey-ee6c9c61b93fae7e041abb19e42134d3a831a846.tar.bz2 |
Merge branch 'pr_115'
Fix connect() return value in offline mode
Fixes #115
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; |