Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2021-04-30 21:56:31 +0300
committerCorinna Vinschen <corinna@vinschen.de>2021-04-30 22:07:26 +0300
commite3b228f098c89bb4e382bb091a7888f3cc807454 (patch)
treeac92dc3d62324f39492ddcf6de7d9a70e2e7a8a4
parent85d0081f0e5de0cf77d20c3777613fb3740e583e (diff)
never block when peekingtopic/mq_af_unix_fiddeling
-rw-r--r--winsup/cygwin/posix_ipc.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/posix_ipc.cc b/winsup/cygwin/posix_ipc.cc
index 1f13c2298..1e5e40144 100644
--- a/winsup/cygwin/posix_ipc.cc
+++ b/winsup/cygwin/posix_ipc.cc
@@ -966,7 +966,8 @@ _mq_receive (mqd_t mqd, char *ptr, size_t maxlen, unsigned int *priop,
}
if (attr->mq_curmsgs == 0) /* queue is empty */
{
- if (mqinfo->mqi_flags & O_NONBLOCK)
+ /* Don't block if O_NONBLOCK is set or when peeking */
+ if ((mqinfo->mqi_flags & O_NONBLOCK) || (flags & _MQ_PEEK_PACKET))
{
set_errno (EAGAIN);
__leave;