diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-09-14 11:10:11 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-09-14 11:10:11 +0100 |
commit | 81b8f20732954c4508baf2f77472b5435e3f851f (patch) | |
tree | 4180177cb7ba85eab50159ce96218c2419fb24a6 /dev-libs/libcgroup/files | |
parent | 946859e0e36904cffb3e0ccbccb6b7b1347c1cc8 (diff) |
gentoo auto-resync : 14:09:2022 - 11:10:10
Diffstat (limited to 'dev-libs/libcgroup/files')
-rw-r--r-- | dev-libs/libcgroup/files/libcgroup-3.0.0-configure-bashism.patch | 35 | ||||
-rw-r--r-- | dev-libs/libcgroup/files/libcgroup-3.0.0-musl-strerror_r.patch | 45 |
2 files changed, 80 insertions, 0 deletions
diff --git a/dev-libs/libcgroup/files/libcgroup-3.0.0-configure-bashism.patch b/dev-libs/libcgroup/files/libcgroup-3.0.0-configure-bashism.patch new file mode 100644 index 000000000000..1401953b53a7 --- /dev/null +++ b/dev-libs/libcgroup/files/libcgroup-3.0.0-configure-bashism.patch @@ -0,0 +1,35 @@ +https://github.com/libcgroup/libcgroup/pull/243 + +From a363c163fdeb48e0536545ece856899ed97e99b2 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Sat, 10 Sep 2022 13:52:57 +0100 +Subject: [PATCH] configure.ac: fix bashism + +configure scripts need to be runnable with a POSIX-compliant /bin/sh. + +On many (but not all!) systems, /bin/sh is provided by Bash, so errors +like this aren't spotted. Notably Debian defaults to /bin/sh provided +by dash which doesn't tolerate such bashisms as '=='. + +This retains compatibility with bash. + +Fixes configure warnings/errors like: +``` +checking whether to build static libraries... no +./configure: 14089: test: xno: unexpected operator +checking for x86_64-pc-linux-gnu-g++... x86_64-pc-linux-gnu-g++ +``` + +Signed-off-by: Sam James <sam@gentoo.org> +--- a/configure.ac ++++ b/configure.ac +@@ -137,7 +137,7 @@ AC_ARG_ENABLE([opaque-hierarchy], + AC_ARG_ENABLE([tests], + [AS_HELP_STRING([--enable-tests],[compile libcgroup tests [default=yes]])], + [ +- if test "x$enableval" == xno; then ++ if test "x$enableval" = xno; then + with_tests=false + else + with_tests=true + diff --git a/dev-libs/libcgroup/files/libcgroup-3.0.0-musl-strerror_r.patch b/dev-libs/libcgroup/files/libcgroup-3.0.0-musl-strerror_r.patch new file mode 100644 index 000000000000..cc1b0688c79b --- /dev/null +++ b/dev-libs/libcgroup/files/libcgroup-3.0.0-musl-strerror_r.patch @@ -0,0 +1,45 @@ +https://github.com/libcgroup/libcgroup/pull/236 + +From d190c0c548b3219b75e4c399aa89186e77bbe270 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 23 Aug 2022 20:03:09 -0700 +Subject: [PATCH] api: Use GNU strerror_r when available + +GNU strerror_r is only available in glibc, musl impelents the XSI +version which is slightly different, therefore check if GNU version is +available before using it, otherwise use the XSI compliant version. + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- a/configure.ac ++++ b/configure.ac +@@ -183,6 +183,11 @@ AC_FUNC_REALLOC + AC_FUNC_STAT + AC_CHECK_FUNCS([getmntent hasmntopt memset mkdir rmdir strdup]) + ++orig_CFLAGS="$CFLAGS" ++CFLAGS="$CFLAGS -D_GNU_SOURCE" ++AC_FUNC_STRERROR_R ++CFLAGS="$orig_CFLAGS" ++ + AC_SEARCH_LIBS( + [fts_open], + [fts], +--- a/src/api.c ++++ b/src/api.c +@@ -4571,9 +4571,13 @@ const char *cgroup_strerror(int code) + { + int idx = code % ECGROUPNOTCOMPILED; + +- if (code == ECGOTHER) ++ if (code == ECGOTHER) { ++#ifdef STRERROR_R_CHAR_P + return strerror_r(cgroup_get_last_errno(), errtext, MAXLEN); +- ++#else ++ return strerror_r(cgroup_get_last_errno(), errtext, sizeof (errtext)) ? "unknown error" : errtext; ++#endif ++ } + if (idx >= sizeof(cgroup_strerror_codes)/sizeof(cgroup_strerror_codes[0])) + return "Invalid error code"; + + |