finished restructuring Sys_enable_input

This commit is contained in:
Amy Bowersox 2019-12-09 11:23:06 -07:00
parent 746962454d
commit 4bef88aecc

View File

@ -176,9 +176,8 @@ HRESULT Sys_enable_input(void)
if (ts_fd < 0) if (ts_fd < 0)
{ {
rc = ERRNO_AS_SCODE; rc = ERRNO_AS_SCODE;
Mq_destroy(Sys_Queue);
Log(LFATAL, "Unable to open touchscreen device %s (%08X).", Gconfig.touchscreen_device, rc); Log(LFATAL, "Unable to open touchscreen device %s (%08X).", Gconfig.touchscreen_device, rc);
return rc; goto error_0;
} }
running = 1; running = 1;
@ -186,20 +185,20 @@ HRESULT Sys_enable_input(void)
if (threadrc != 0) if (threadrc != 0)
{ {
rc = SCODE_FROM_ERRNO(threadrc); rc = SCODE_FROM_ERRNO(threadrc);
close(ts_fd);
ts_fd = -1;
Mq_destroy(Sys_Queue);
Log(LFATAL, "Unable to start system input thread (%08X).", rc); Log(LFATAL, "Unable to start system input thread (%08X).", rc);
goto error_1;
} }
if (SUCCEEDED(rc))
{
rc = Config_exitfunc(do_disable_input); rc = Config_exitfunc(do_disable_input);
if (FAILED(rc)) if (FAILED(rc))
do_disable_input(); do_disable_input();
}
return rc; return rc;
error_1:
close(ts_fd);
ts_fd = -1;
error_0: error_0:
Mq_destroy(Sys_Queue);
return rc; return rc;
} }