about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-06-30 09:08:31 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-06-30 09:50:38 -0300
commitcd4f43be3d60384009e9a928d82db815f77ef9b7 (patch)
treed76532ffbe98f678f56e7d90ce58048f9215ef58 /sysdeps/unix/sysv/linux
parentb6aade18a7e5719c942aa2da6cf3157aca993fa4 (diff)
downloadglibc-cd4f43be3d60384009e9a928d82db815f77ef9b7.tar.gz
glibc-cd4f43be3d60384009e9a928d82db815f77ef9b7.tar.xz
glibc-cd4f43be3d60384009e9a928d82db815f77ef9b7.zip
linux: Fix mq_timereceive check for 32 bit fallback code (BZ 29304)
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)
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r--sysdeps/unix/sysv/linux/mq_timedreceive.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/mq_timedreceive.c b/sysdeps/unix/sysv/linux/mq_timedreceive.c
index 834cd7a484..5bf1e0a83b 100644
--- a/sysdeps/unix/sysv/linux/mq_timedreceive.c
+++ b/sysdeps/unix/sysv/linux/mq_timedreceive.c
@@ -41,7 +41,7 @@ ___mq_timedreceive_time64 (mqd_t mqdes, char *__restrict msg_ptr, size_t msg_len
     {
       int r = SYSCALL_CANCEL (mq_timedreceive_time64, mqdes, msg_ptr, msg_len,
 			      msg_prio, abs_timeout);
-      if (r == 0 || errno != ENOSYS)
+      if (r >= 0 || errno != ENOSYS)
 	return r;
       __set_errno (EOVERFLOW);
       return -1;