Commit 63c47e5dc3bf4c0808e0d0f783286e768635cb88

Authored by perry.werneck@gmail.com
1 parent 2760e10b

Iniciando atualizações da lib para a versão 5

Showing 1 changed file with 8 additions and 20 deletions   Show diff stats
host.c
... ... @@ -516,22 +516,8 @@ static int do_connect(H3270 *hSession, const char *n)
516 516 &hSession->passthru_host, &hSession->non_tn3270e_host, &hSession->ssl_host,
517 517 &hSession->no_login_host, hSession->luname, &port,
518 518 &needed)) == CN)
519   - return -1;
  519 + return EINVAL;
520 520  
521   - /* Look up the name in the hosts file. */ /*
522   - if (!needed && hostfile_lookup(s, &target_name, &ps)) {
523   - //
524   - // Rescan for qualifiers.
525   - // Qualifiers, LU names, and ports are all overridden
526   - // by the hosts file.
527   - //
528   - Free(s);
529   - if (!(s = split_host(target_name, &ansi_host,
530   - &std_ds_host, &passthru_host, &non_tn3270e_host,
531   - &ssl_host, &no_login_host, hSession->luname, &port,
532   - &needed)))
533   - return -1;
534   - } */
535 521 chost = s;
536 522  
537 523 /* Default the port. */
... ... @@ -620,8 +606,9 @@ static int do_connect(H3270 *hSession, const char *n)
620 606  
621 607 int lib3270_connect(H3270 *h, const char *n, int wait)
622 608 {
623   - if(!h)
624   - h = &h3270;
  609 + int rc;
  610 +
  611 + CHECK_SESSION_HANDLE(h);
625 612  
626 613 RunPendingEvents(0);
627 614  
... ... @@ -631,8 +618,9 @@ int lib3270_connect(H3270 *h, const char *n, int wait)
631 618 if(PCONNECTED)
632 619 return EBUSY;
633 620  
634   - if(do_connect(h,n))
635   - return -1;
  621 + rc = do_connect(h,n);
  622 + if(rc)
  623 + return rc;
636 624  
637 625 if(wait)
638 626 {
... ... @@ -647,7 +635,7 @@ int lib3270_connect(H3270 *h, const char *n, int wait)
647 635 }
648 636 }
649 637  
650   - return 0;
  638 + return rc;
651 639 }
652 640  
653 641 /*
... ...