diff --git a/iocalls.c b/iocalls.c index 6f41a04..6f161e4 100644 --- a/iocalls.c +++ b/iocalls.c @@ -529,8 +529,7 @@ static int internal_event_dispatcher(H3270 *hSession, int block) static int internal_callthread(int(*callback)(H3270 *, void *), H3270 *session, void *parm) { - callback(session,parm); - return 0; + return callback(session,parm); } static int internal_wait(H3270 *hSession, int seconds) @@ -697,20 +696,18 @@ LIB3270_EXPORT int lib3270_register_handlers(const struct lib3270_callbacks *cbk LIB3270_EXPORT int lib3270_call_thread(int(*callback)(H3270 *h, void *), H3270 *h, void *parm) { -// int rc; + int rc; CHECK_SESSION_HANDLE(h); - if(h->set_timer) - h->set_timer(h,1); + h->set_timer(h,1); lib3270_main_iterate(h,0); - callthread(callback,h,parm); + rc = callthread(callback,h,parm); lib3270_main_iterate(h,0); - if(h->set_timer) - h->set_timer(h,0); + h->set_timer(h,0); - return 0; + return rc; } LIB3270_EXPORT void lib3270_main_iterate(H3270 *hSession, int block) diff --git a/session.c b/session.c index 8f24178..1fabc5b 100644 --- a/session.c +++ b/session.c @@ -155,6 +155,10 @@ static void update_ssl(H3270 *session, LIB3270_SSL_STATE state) { } +static void set_timer(H3270 *session, unsigned char on) +{ +} + static void screen_disp(H3270 *session) { CHECK_SESSION_HANDLE(session); @@ -198,6 +202,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model) hSession->set_width = nop_int; hSession->update_status = (void (*)(H3270 *, LIB3270_STATUS)) nop_int; hSession->autostart = nop; + hSession->set_timer = set_timer; // Set the defaults. hSession->extended = 1; -- libgit2 0.21.2