Cygwin: POSIX msg queues: simplify mq_close

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2021-05-25 16:36:09 +02:00
parent 15c96f2b26
commit 2cc914a34e
2 changed files with 3 additions and 7 deletions

View File

@ -180,9 +180,8 @@ fhandler_mqueue::close ()
NtClose (mqinfo ()->mqi_waitsend);
NtClose (mqinfo ()->mqi_waitrecv);
NtClose (mqinfo ()->mqi_lock);
ret = 0;
}
__except (EFAULT) {}
__except (0) {}
__endtry
return ret;
return 0;
}

View File

@ -882,13 +882,10 @@ mq_timedreceive (mqd_t mqd, char *ptr, size_t maxlen, unsigned int *priop,
extern "C" int
mq_close (mqd_t mqd)
{
struct mq_info *mqinfo;
__try
{
cygheap_fdget fd ((int) mqd, true);
mqinfo = get_mqinfo (fd);
if (mqinfo->mqi_magic != MQI_MAGIC)
if (!fd->is_mqueue ())
{
set_errno (EBADF);
__leave;