From 97072052106c4c2a6a6d6325b8ee85e9c11b7eac Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Tue, 12 Feb 2019 15:38:26 -0200 Subject: [PATCH] lib3270_disconnect returns a valid rc in case of error. --- src/lib3270/host.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib3270/host.c b/src/lib3270/host.c index 35e7bff..c80440c 100644 --- a/src/lib3270/host.c +++ b/src/lib3270/host.c @@ -93,7 +93,8 @@ int host_disconnect(H3270 *hSession, int failed) net_disconnect(hSession); trace("Disconnected (Failed: %d Reconnect: %d in_progress: %d)",failed,lib3270_get_toggle(hSession,LIB3270_TOGGLE_RECONNECT),hSession->auto_reconnect_inprogress); - if (lib3270_get_toggle(hSession,LIB3270_TOGGLE_RECONNECT) && !hSession->auto_reconnect_inprogress) + + if(failed && lib3270_get_toggle(hSession,LIB3270_TOGGLE_RECONNECT) && !hSession->auto_reconnect_inprogress) { /* Schedule an automatic reconnection. */ hSession->auto_reconnect_inprogress = 1; @@ -115,8 +116,7 @@ int host_disconnect(H3270 *hSession, int failed) } - errno = ENOTCONN; - return -1; + return errno = ENOTCONN; } -- libgit2 0.21.2