From 9ca906680811a89baeefcf8219905e597e6e3a68 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Tue, 4 Aug 2020 11:10:07 -0300 Subject: [PATCH] Fixing keyboard lock status and program messages issues. --- src/core/screen.c | 13 +++++++------ src/core/session.c | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/core/screen.c b/src/core/screen.c index 9869ae2..97613eb 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -592,15 +592,16 @@ void status_reset(H3270 *session) } /** - * Query the updated terminal status. + * @brief Query the updated terminal status. * * @return status-code. * * @see LIB3270_MESSAGE */ -LIB3270_EXPORT LIB3270_MESSAGE lib3270_get_program_message(const H3270 *session) +LIB3270_EXPORT LIB3270_MESSAGE lib3270_get_program_message(const H3270 *hSession) { - return session->oia.status; + debug("OIA Status=%d",hSession->oia.status); + return hSession->oia.status; } /** @@ -616,12 +617,12 @@ LIB3270_EXPORT LIB3270_MESSAGE lib3270_get_program_message(const H3270 *session) */ LIB3270_EXPORT LIB3270_MESSAGE lib3270_get_lock_status(const H3270 *hSession) { - if(hSession->oia.status) - return hSession->oia.status; - if(hSession->kybdlock) return LIB3270_MESSAGE_KYBDLOCK; + if(hSession->oia.status) + return hSession->oia.status; + return LIB3270_MESSAGE_NONE; } diff --git a/src/core/session.c b/src/core/session.c index 859ec16..85c3498 100644 --- a/src/core/session.c +++ b/src/core/session.c @@ -334,7 +334,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char hSession->connection.sock = -1; hSession->model_num = -1; hSession->connection.state = LIB3270_NOT_CONNECTED; - hSession->oia.status = -1; + hSession->oia.status = LIB3270_MESSAGE_DISCONNECTED; hSession->kybdlock = KL_NOT_CONNECTED; hSession->aid = AID_NO; hSession->reply_mode = SF_SRM_FIELD; -- libgit2 0.21.2