diff --git a/src/core/ctlr.c b/src/core/ctlr.c index f703290..2a4238e 100644 --- a/src/core/ctlr.c +++ b/src/core/ctlr.c @@ -205,7 +205,7 @@ void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr) // popup_an_error(session,"Invalid %s %dx%d:\nToo big",ResOversize, ovc, ovr); } - else if (ovc > 0 && ovc < session->max.cols) + else if (ovc < session->max.cols) { lib3270_popup_dialog( @@ -219,7 +219,7 @@ void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr) // popup_an_error(session,"Invalid %s cols (%d):\nLess than model %d cols (%d)",ResOversize, ovc, session->model_num, session->maxCOLS); } - else if (ovr > 0 && ovr < session->max.rows) + else if (ovr < session->max.rows) { lib3270_popup_dialog( diff --git a/src/core/linux/connect.c b/src/core/linux/connect.c index e2edde8..898223c 100644 --- a/src/core/linux/connect.c +++ b/src/core/linux/connect.c @@ -89,7 +89,7 @@ case 1: // Got response. - if(pfd.revents && POLLOUT) { + if(pfd.revents & POLLOUT) { debug("%s: Connection complete",__FUNCTION__); return 0; } @@ -194,15 +194,23 @@ if(hSession->network.module->getsockopt(hSession, SOL_SOCKET, SO_ERROR, (char *) &err, &len) < 0) { - int err = errno; + lib3270_autoptr(char) body = lib3270_strdup_printf( + _("The System error was '%s' (rc=%d)"), + strerror(errno), + errno + ); + lib3270_disconnect(hSession); - lib3270_popup_dialog( - hSession, - LIB3270_NOTIFY_ERROR, - _( "Network error" ), - _( "Unable to get connection state." ), - _( "The system error was %s" ), strerror(err) - ); + + LIB3270_POPUP popup = { + .type = LIB3270_NOTIFY_ERROR, + .title = _( "Network error" ), + .summary = _( "Unable to get connection state." ), + .body = body + }; + + lib3270_popup(hSession,&popup,0); + return; } else if(err) -- libgit2 0.21.2