diff options
| -rw-r--r-- | meta/recipes-core/libcgroup/libcgroup/0001-api-Use-GNU-strerror_r-when-available.patch | 55 | ||||
| -rw-r--r-- | meta/recipes-core/libcgroup/libcgroup_3.1.0.bb (renamed from meta/recipes-core/libcgroup/libcgroup_3.0.0.bb) | 8 |
2 files changed, 4 insertions, 59 deletions
diff --git a/meta/recipes-core/libcgroup/libcgroup/0001-api-Use-GNU-strerror_r-when-available.patch b/meta/recipes-core/libcgroup/libcgroup/0001-api-Use-GNU-strerror_r-when-available.patch deleted file mode 100644 index 96321d2970..0000000000 --- a/meta/recipes-core/libcgroup/libcgroup/0001-api-Use-GNU-strerror_r-when-available.patch +++ /dev/null | |||
| @@ -1,55 +0,0 @@ | |||
| 1 | From d190c0c548b3219b75e4c399aa89186e77bbe270 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 23 Aug 2022 20:03:09 -0700 | ||
| 4 | Subject: [PATCH] api: Use GNU strerror_r when available | ||
| 5 | |||
| 6 | GNU strerror_r is only available in glibc, musl impelents the XSI | ||
| 7 | version which is slightly different, therefore check if GNU version is | ||
| 8 | available before using it, otherwise use the XSI compliant version. | ||
| 9 | |||
| 10 | Upstream-Status: Submitted [https://github.com/libcgroup/libcgroup/pull/236] | ||
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 12 | --- | ||
| 13 | configure.ac | 5 +++++ | ||
| 14 | src/api.c | 8 ++++++-- | ||
| 15 | 2 files changed, 11 insertions(+), 2 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/configure.ac b/configure.ac | ||
| 18 | index b68c655..831866d 100644 | ||
| 19 | --- a/configure.ac | ||
| 20 | +++ b/configure.ac | ||
| 21 | @@ -183,6 +183,11 @@ AC_FUNC_REALLOC | ||
| 22 | AC_FUNC_STAT | ||
| 23 | AC_CHECK_FUNCS([getmntent hasmntopt memset mkdir rmdir strdup]) | ||
| 24 | |||
| 25 | +orig_CFLAGS="$CFLAGS" | ||
| 26 | +CFLAGS="$CFLAGS -D_GNU_SOURCE" | ||
| 27 | +AC_FUNC_STRERROR_R | ||
| 28 | +CFLAGS="$orig_CFLAGS" | ||
| 29 | + | ||
| 30 | AC_SEARCH_LIBS( | ||
| 31 | [fts_open], | ||
| 32 | [fts], | ||
| 33 | diff --git a/src/api.c b/src/api.c | ||
| 34 | index 5c6de11..06aa1d6 100644 | ||
| 35 | --- a/src/api.c | ||
| 36 | +++ b/src/api.c | ||
| 37 | @@ -4571,9 +4571,13 @@ const char *cgroup_strerror(int code) | ||
| 38 | { | ||
| 39 | int idx = code % ECGROUPNOTCOMPILED; | ||
| 40 | |||
| 41 | - if (code == ECGOTHER) | ||
| 42 | + if (code == ECGOTHER) { | ||
| 43 | +#ifdef STRERROR_R_CHAR_P | ||
| 44 | return strerror_r(cgroup_get_last_errno(), errtext, MAXLEN); | ||
| 45 | - | ||
| 46 | +#else | ||
| 47 | + return strerror_r(cgroup_get_last_errno(), errtext, sizeof (errtext)) ? "unknown error" : errtext; | ||
| 48 | +#endif | ||
| 49 | + } | ||
| 50 | if (idx >= sizeof(cgroup_strerror_codes)/sizeof(cgroup_strerror_codes[0])) | ||
| 51 | return "Invalid error code"; | ||
| 52 | |||
| 53 | -- | ||
| 54 | 2.37.2 | ||
| 55 | |||
diff --git a/meta/recipes-core/libcgroup/libcgroup_3.0.0.bb b/meta/recipes-core/libcgroup/libcgroup_3.1.0.bb index 457b965481..4b4f19e36f 100644 --- a/meta/recipes-core/libcgroup/libcgroup_3.0.0.bb +++ b/meta/recipes-core/libcgroup/libcgroup_3.1.0.bb | |||
| @@ -12,15 +12,15 @@ inherit autotools pkgconfig github-releases | |||
| 12 | DEPENDS = "bison-native flex-native" | 12 | DEPENDS = "bison-native flex-native" |
| 13 | DEPENDS:append:libc-musl = " fts" | 13 | DEPENDS:append:libc-musl = " fts" |
| 14 | 14 | ||
| 15 | SRC_URI = "${GITHUB_BASE_URI}/download/v3.0/${BP}.tar.gz \ | 15 | SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${BP}.tar.gz \ |
| 16 | file://0001-api-Use-GNU-strerror_r-when-available.patch \ | ||
| 17 | " | 16 | " |
| 18 | UPSTREAM_CHECK_URI = "https://github.com/libcgroup/libcgroup/tags" | 17 | UPSTREAM_CHECK_URI = "https://github.com/libcgroup/libcgroup/tags" |
| 19 | 18 | ||
| 20 | SRC_URI[sha256sum] = "8d284d896fca1c981b55850e92acd3ad9648a69227c028dda7ae3402af878edd" | 19 | SRC_URI[sha256sum] = "976ec4b1e03c0498308cfd28f1b256b40858f636abc8d1f9db24f0a7ea9e1258" |
| 21 | 20 | ||
| 22 | PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" | 21 | PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}" |
| 23 | PACKAGECONFIG[pam] = "--enable-pam-module-dir=${base_libdir}/security --enable-pam=yes,--enable-pam=no,libpam" | 22 | PACKAGECONFIG[pam] = "--enable-pam-module-dir=${base_libdir}/security --enable-pam=yes,--enable-pam=no,libpam" |
| 23 | PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd" | ||
| 24 | 24 | ||
| 25 | PACKAGES =+ "cgroups-pam-plugin" | 25 | PACKAGES =+ "cgroups-pam-plugin" |
| 26 | FILES:cgroups-pam-plugin = "${base_libdir}/security/pam_cgroup.so*" | 26 | FILES:cgroups-pam-plugin = "${base_libdir}/security/pam_cgroup.so*" |
