]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: POSIX mq: only allo priority up to MQ_PRIO_MAX - 1
authorCorinna Vinschen <corinna@vinschen.de>
Thu, 29 Apr 2021 18:04:24 +0000 (20:04 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 29 Apr 2021 18:09:10 +0000 (20:09 +0200)
POSIX requires that message priorities range from 0 (low) to
sysconf(_SC_MQ_PRIO_MAX) - 1 (high).  Cygwin's mq_send erroneously
allowed a message priority of sysconf(_SC_MQ_PRIO_MAX).  Fix it.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/posix_ipc.cc

index eec9ffe6353430ea4507e3a6a0e809434e911eef..c6a003c37af90296dd94513fa0199c8eb123fa7d 100644 (file)
@@ -798,7 +798,7 @@ _mq_send (mqd_t mqd, const char *ptr, size_t len, unsigned int prio,
          set_errno (EBADF);
          __leave;
        }
-      if (prio > MQ_PRIO_MAX)
+      if (prio >= MQ_PRIO_MAX)
        {
          set_errno (EINVAL);
          __leave;
This page took 0.033733 seconds and 5 git commands to generate.