enhanced how to handle an error after mio_dev_make() failure by implementing fail_after_make callbacks in pipe, thr, pro

decided to not call pthread_cancel in thr.c because it's too difficult to get it right
This commit is contained in:
2020-07-31 15:07:28 +00:00
parent a2e3195417
commit c230c92249
6 changed files with 720 additions and 57 deletions

View File

@ -381,8 +381,14 @@ static int dev_sck_make (mio_dev_t* dev, void* ctx)
return 0;
oops:
if (hnd != MIO_SYSHND_INVALID) close (hnd);
if (side_chan != MIO_SYSHND_INVALID) close (side_chan);
if (hnd != MIO_SYSHND_INVALID)
{
close (hnd);
}
if (side_chan != MIO_SYSHND_INVALID)
{
close (side_chan);
}
return -1;
}