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 /NitrokeyManager.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 'NitrokeyManager.cc')
-rw-r--r-- | NitrokeyManager.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index addfdbf..ab4cac5 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -234,12 +234,14 @@ using nitrokey::misc::strcpyT; bool NitrokeyManager::connect() { std::lock_guard<std::mutex> lock(mex_dev_com_manager); vector< shared_ptr<Device> > devices = { make_shared<Stick10>(), make_shared<Stick20>() }; + bool connected = false; for( auto & d : devices ){ if (d->connect()){ device = std::shared_ptr<Device>(d); + connected = true; } } - return device != nullptr; + return connected; } |