python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / security / super / 0001-Remove-references-to-dropped-sys_nerr-sys_errlist-fo.patch
blob048486caafd782cf78fe197337c529a0f5a7c19a
1 From 86e37c1c09c23924c4e055a3d4b8c79f19cd0599 Mon Sep 17 00:00:00 2001
2 From: Maximilian Bosch <maximilian@mbosch.me>
3 Date: Mon, 10 Aug 2020 21:33:39 +0200
4 Subject: [PATCH] Remove references to dropped `sys_nerr` & `sys_errlist` for
5 `glibc-2.32` compat
7 According to the release-notes[1], `strerror(3)` should be used. This is
8 already the case, however the source tries to be backwards-compatible by
9 supporting `sys_nerr` & `sys_errlist` which breaks compilation
10 unfortunately.
12 Simply using `strerror` fixes the problems.
14 [1] https://sourceware.org/pipermail/libc-announce/2020/000029.html
15 ---
16 utils.c | 12 +-----------
17 1 file changed, 1 insertion(+), 11 deletions(-)
19 diff --git a/utils.c b/utils.c
20 index 3ec70b6..430f027 100644
21 --- a/utils.c
22 +++ b/utils.c
23 @@ -2003,7 +2003,6 @@ int n;
25 #ifdef HAVE_SYS_ERRLIST
26 extern char *sys_errlist[];
27 - extern int sys_nerr;
28 #endif
31 @@ -2019,16 +2018,7 @@ int errnum;
32 sprintf(buf, "Error %d", errnum);
33 return buf;
34 #else
35 - if (errnum < 0 || errnum > sys_nerr) {
36 - sprintf(buf, "Error %d (!)", errnum);
37 - return buf;
38 - } else {
39 -#ifdef HAVE_STRERROR
40 - return strerror(errnum);
41 -#else
42 - return sys_errlist[errnum];
43 -#endif
44 - }
45 + return strerror(errnum);
46 #endif
49 --
50 2.25.4