]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
linux: Fix mq_timereceive check for 32 bit fallback code (BZ 29304)
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 30 Jun 2022 12:08:31 +0000 (09:08 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 30 Jun 2022 13:46:55 +0000 (10:46 -0300)
On  success,  mq_receive() and mq_timedreceive() return the number of
bytes in the received message, so it requires to check if the value
is larger than 0.

Checked on i686-linux-gnu.

(cherry picked from commit 71d87d85bf54f6522813aec97c19bdd24997341e)

sysdeps/unix/sysv/linux/mq_timedreceive.c

index 728a63d1ec6359eaebae41cc7ab5c0cc4529a95d..fda57be19deb96a70902dd60d3680e8fe53caa1b 100644 (file)
@@ -35,7 +35,7 @@ __mq_timedreceive_time64 (mqd_t mqdes, char *__restrict msg_ptr, size_t msg_len,
 #else
   int ret = SYSCALL_CANCEL (mq_timedreceive_time64, mqdes, msg_ptr, msg_len,
                             msg_prio, abs_timeout);
-  if (ret == 0 || errno != ENOSYS)
+  if (ret >= 0 || errno != ENOSYS)
     return ret;
 
   struct timespec ts32;