08c3a6
commit 4b246b2bbd1d5a77035bb990d6097b7337c34bbb
08c3a6
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
08c3a6
Date:   Thu Jun 30 09:08:31 2022 -0300
08c3a6
08c3a6
    linux: Fix mq_timereceive check for 32 bit fallback code (BZ 29304)
08c3a6
    
08c3a6
    On  success,  mq_receive() and mq_timedreceive() return the number of
08c3a6
    bytes in the received message, so it requires to check if the value
08c3a6
    is larger than 0.
08c3a6
    
08c3a6
    Checked on i686-linux-gnu.
08c3a6
    
08c3a6
    (cherry picked from commit 71d87d85bf54f6522813aec97c19bdd24997341e)
08c3a6
08c3a6
diff --git a/sysdeps/unix/sysv/linux/mq_timedreceive.c b/sysdeps/unix/sysv/linux/mq_timedreceive.c
08c3a6
index 7f3a112d7f2cbbe7..1fc98752e7d6d506 100644
08c3a6
--- a/sysdeps/unix/sysv/linux/mq_timedreceive.c
08c3a6
+++ b/sysdeps/unix/sysv/linux/mq_timedreceive.c
08c3a6
@@ -41,7 +41,7 @@ ___mq_timedreceive_time64 (mqd_t mqdes, char *__restrict msg_ptr, size_t msg_len
08c3a6
     {
08c3a6
       int r = SYSCALL_CANCEL (mq_timedreceive_time64, mqdes, msg_ptr, msg_len,
08c3a6
 			      msg_prio, abs_timeout);
08c3a6
-      if (r == 0 || errno != ENOSYS)
08c3a6
+      if (r >= 0 || errno != ENOSYS)
08c3a6
 	return r;
08c3a6
       __set_errno (EOVERFLOW);
08c3a6
       return -1;