Cygwin: POSIX mq: only allo priority up to MQ_PRIO_MAX - 1

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>
This commit is contained in:
Corinna Vinschen 2021-04-29 20:04:24 +02:00
parent c66797eef8
commit 4f89f24fbe
1 changed files with 1 additions and 1 deletions

View 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;