enhanced qse_mux_setupchan() with more error handling

This commit is contained in:
hyung-hwan 2020-09-08 16:29:50 +00:00
parent 6907c9ca95
commit e5aabf7d56

View File

@ -1146,7 +1146,16 @@ int qse_mux_setupchan (qse_mux_t* mux)
evt.hnd = mux->chan[0]; evt.hnd = mux->chan[0];
evt.mask = QSE_MUX_IN; evt.mask = QSE_MUX_IN;
/*evt.data = ... */ /*evt.data = ... */
return qse_mux_insert(mux, &evt); if (qse_mux_insert(mux, &evt) <= -1)
{
close (mux->chan[0]);
close (mux->chan[1]);
mux->chan[0] = INVALID_CHAN;
mux->chan[1] = INVALID_CHAN;
}
return 0;
} }
void qse_mux_interrupt (qse_mux_t* mux) void qse_mux_interrupt (qse_mux_t* mux)