330b961e66
Upstream commit: 4ed990e5b97a61f29f929bdeb36c5b2abb547a64 - Add MADV_POPULATE_READ and MADV_POPULATE_WRITE from Linux 5.14 to bits/mman-linux.h - Update kernel version to 5.14 in tst-mman-consts.py - Update syscall lists for Linux 5.14 - Use Linux 5.14 in build-many-glibcs.py - Fix failing nss/tst-nss-files-hosts-long with local resolver - iconvconfig: Fix behaviour with --prefix [BZ #28199] - nptl: Fix race between pthread_kill and thread exit (swbz#12889, #1994068) - nptl: pthread_kill, pthread_cancel should not fail after exit (swbz#19193, #1994068) - support: Add support_wait_for_thread_exit - MIPS: Setup errno for {f,l,}xstat - x86-64: Use testl to check __x86_string_control - elf: Fix missing colon in LD_SHOW_AUXV output (swbz#28253, #1995648) - librt: add test (swbz#28213, #1994264) - CVE-2021-38604: fix NULL pointer dereference in mq_notify (swbz#28213, #1994264) - Linux: Fix fcntl, ioctl, prctl redirects for _TIME_BITS=64 (bug 28182) - iconv_charmap: Close output file when done - copy_and_spawn_sgid: Avoid double calls to close() - gaiconf_init: Avoid double-free in label and precedence lists - gconv_parseconfdir: Fix memory leak - ldconfig: avoid leak on empty paths in config file
63 lines
2.2 KiB
Diff
63 lines
2.2 KiB
Diff
commit 52d0119743180164d1664b6773ac5d873f224608
|
|
Author: Jiaxun Yang <jiaxun.yang@flygoat.com>
|
|
Date: Tue Sep 7 13:31:42 2021 +0800
|
|
|
|
MIPS: Setup errno for {f,l,}xstat
|
|
|
|
{f,l,}xstat stub for MIPS is using INTERNAL_SYSCALL
|
|
to do xstat syscall for glibc ver, However it leaves
|
|
errno untouched and thus giving bad errno output.
|
|
|
|
Setup errno properly when syscall returns non-zero.
|
|
|
|
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
|
|
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
|
|
|
(cherry picked from commit 66016ec8aeefd40e016d7040d966484c764b0e9c)
|
|
|
|
diff --git a/sysdeps/unix/sysv/linux/mips/fxstat.c b/sysdeps/unix/sysv/linux/mips/fxstat.c
|
|
index 11511d30b38708ce..4a6016ff123e8dd9 100644
|
|
--- a/sysdeps/unix/sysv/linux/mips/fxstat.c
|
|
+++ b/sysdeps/unix/sysv/linux/mips/fxstat.c
|
|
@@ -35,7 +35,9 @@ __fxstat (int vers, int fd, struct stat *buf)
|
|
{
|
|
struct kernel_stat kbuf;
|
|
int r = INTERNAL_SYSCALL_CALL (fstat, fd, &kbuf);
|
|
- return r ?: __xstat_conv (vers, &kbuf, buf);
|
|
+ if (r == 0)
|
|
+ return __xstat_conv (vers, &kbuf, buf);
|
|
+ return INLINE_SYSCALL_ERROR_RETURN_VALUE (-r);
|
|
}
|
|
}
|
|
}
|
|
diff --git a/sysdeps/unix/sysv/linux/mips/lxstat.c b/sysdeps/unix/sysv/linux/mips/lxstat.c
|
|
index 871fb6c6c5886665..54f990a250677091 100644
|
|
--- a/sysdeps/unix/sysv/linux/mips/lxstat.c
|
|
+++ b/sysdeps/unix/sysv/linux/mips/lxstat.c
|
|
@@ -35,7 +35,9 @@ __lxstat (int vers, const char *name, struct stat *buf)
|
|
{
|
|
struct kernel_stat kbuf;
|
|
int r = INTERNAL_SYSCALL_CALL (lstat, name, &kbuf);
|
|
- return r ?: __xstat_conv (vers, &kbuf, buf);
|
|
+ if (r == 0)
|
|
+ return __xstat_conv (vers, &kbuf, buf);
|
|
+ return INLINE_SYSCALL_ERROR_RETURN_VALUE (-r);
|
|
}
|
|
}
|
|
}
|
|
diff --git a/sysdeps/unix/sysv/linux/mips/xstat.c b/sysdeps/unix/sysv/linux/mips/xstat.c
|
|
index 9d810b6f653b964b..86f4dc31a82ff1bb 100644
|
|
--- a/sysdeps/unix/sysv/linux/mips/xstat.c
|
|
+++ b/sysdeps/unix/sysv/linux/mips/xstat.c
|
|
@@ -35,7 +35,9 @@ __xstat (int vers, const char *name, struct stat *buf)
|
|
{
|
|
struct kernel_stat kbuf;
|
|
int r = INTERNAL_SYSCALL_CALL (stat, name, &kbuf);
|
|
- return r ?: __xstat_conv (vers, &kbuf, buf);
|
|
+ if (r == 0)
|
|
+ return __xstat_conv (vers, &kbuf, buf);
|
|
+ return INLINE_SYSCALL_ERROR_RETURN_VALUE (-r);
|
|
}
|
|
}
|
|
}
|