diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2021-05-25 16:36:09 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2021-05-25 16:41:45 +0200 |
commit | 2cc914a34e505e7ce13b18d0f517b58a996a2d1e (patch) | |
tree | 68cd407182f878287ea5197cf0b345d99845d4f3 | |
parent | 15c96f2b2660d7a7776c61c9dc78d64262918955 (diff) | |
download | newlib-2cc914a34e505e7ce13b18d0f517b58a996a2d1e.zip newlib-2cc914a34e505e7ce13b18d0f517b58a996a2d1e.tar.gz newlib-2cc914a34e505e7ce13b18d0f517b58a996a2d1e.tar.bz2 |
Cygwin: POSIX msg queues: simplify mq_close
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r-- | winsup/cygwin/fhandler_mqueue.cc | 5 | ||||
-rw-r--r-- | winsup/cygwin/posix_ipc.cc | 5 |
2 files changed, 3 insertions, 7 deletions
diff --git a/winsup/cygwin/fhandler_mqueue.cc b/winsup/cygwin/fhandler_mqueue.cc index 6fc17c2..5f97264 100644 --- a/winsup/cygwin/fhandler_mqueue.cc +++ b/winsup/cygwin/fhandler_mqueue.cc @@ -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; } diff --git a/winsup/cygwin/posix_ipc.cc b/winsup/cygwin/posix_ipc.cc index 8101a28..1f913c8 100644 --- a/winsup/cygwin/posix_ipc.cc +++ b/winsup/cygwin/posix_ipc.cc @@ -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; |