diff --git a/src/core/get.cc b/src/core/get.cc index 6922fa5..f29efd1 100644 --- a/src/core/get.cc +++ b/src/core/get.cc @@ -35,8 +35,7 @@ try { - TN3270::Host &host = getSession(); - worker(host); + worker(getSession()); } catch(const std::system_error &e) { @@ -96,8 +95,6 @@ strncpy((char *) buffer, contents.c_str(), std::min((size_t) len,contents.size())); }); - - } HLLAPI_API_CALL hllapi_get_lu_name(LPSTR buffer, WORD len) { diff --git a/src/core/keyboard.cc b/src/core/keyboard.cc index d2c0373..c437c6a 100644 --- a/src/core/keyboard.cc +++ b/src/core/keyboard.cc @@ -35,14 +35,11 @@ static DWORD set(std::function worker) noexcept { try { - TN3270::Host &host = getSession(); + worker(getSession()); - if(!host.isConnected()) - return HLLAPI_STATUS_DISCONNECTED; + } catch(const std::system_error &e) { - host.waitForReady(); - - worker(host); + return hllapi_translate_error(e); } catch(const std::exception &e) { -- libgit2 0.21.2