diff options
author | Sam James <sam@gentoo.org> | 2022-11-18 17:59:02 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-11-18 17:59:02 +0000 |
commit | 39e348fad976c54d3980c2149de6365e8d035a4d (patch) | |
tree | 6da934eda7ad6043ed5c60126a9f25c4253091d0 /sys-fs | |
parent | dev-java/openjdk: update metadata (diff) | |
download | gentoo-39e348fad976c54d3980c2149de6365e8d035a4d.tar.gz gentoo-39e348fad976c54d3980c2149de6365e8d035a4d.tar.bz2 gentoo-39e348fad976c54d3980c2149de6365e8d035a4d.zip |
sys-fs/lvm2: fix strerror_r check for musl
Closes: https://bugs.gentoo.org/869404
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-fs')
-rw-r--r-- | sys-fs/lvm2/files/lvm2-2.03.16-musl-strerror_r.patch | 23 | ||||
-rw-r--r-- | sys-fs/lvm2/lvm2-2.03.16-r2.ebuild | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sys-fs/lvm2/files/lvm2-2.03.16-musl-strerror_r.patch b/sys-fs/lvm2/files/lvm2-2.03.16-musl-strerror_r.patch new file mode 100644 index 000000000000..d485e75ca811 --- /dev/null +++ b/sys-fs/lvm2/files/lvm2-2.03.16-musl-strerror_r.patch @@ -0,0 +1,23 @@ +From a06e401bd0479f25631bdfeffaa01d150e5efe59 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Fri, 18 Nov 2022 17:57:34 +0000 +Subject: [PATCH] Fix strerror_r check for musl + +We can't assume that strerror_r returns char* just because _GNU_SOURCE is defined. We already call the appropriate autoconf test, so let's use its result +(STRERROR_R_CHAR_P). + +Note that in configure, _GNU_SOURCE is always set, but we add a defined guard just in case for futureproofing. + +Bug: https://bugs.gentoo.org/869404 +Signed-off-by: Sam James <sam@gentoo.org> +--- a/daemons/lvmpolld/lvmpolld-core.c ++++ b/daemons/lvmpolld/lvmpolld-core.c +@@ -52,7 +52,7 @@ static pthread_key_t key; + + static const char *_strerror_r(int errnum, struct lvmpolld_thread_data *data) + { +-#ifdef _GNU_SOURCE ++#if defined(_GNU_SOURCE) && defined(STRERROR_R_CHAR_P) + return strerror_r(errnum, data->buf, sizeof(data->buf)); /* never returns NULL */ + #elif (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) + return strerror_r(errnum, data->buf, sizeof(data->buf)) ? "" : data->buf; diff --git a/sys-fs/lvm2/lvm2-2.03.16-r2.ebuild b/sys-fs/lvm2/lvm2-2.03.16-r2.ebuild index 2397a59911fa..dca72ccfd4a0 100644 --- a/sys-fs/lvm2/lvm2-2.03.16-r2.ebuild +++ b/sys-fs/lvm2/lvm2-2.03.16-r2.ebuild @@ -73,6 +73,7 @@ PATCHES=( "${FILESDIR}"/${PN}-2.03.14-r1-mallinfo.patch "${FILESDIR}"/${PN}-2.03.14-freopen_n2.patch "${FILESDIR}"/${PN}-2.03.16-readelf.patch + "${FILESDIR}"/${PN}-2.03.16-musl-strerror_r.patch ) QA_CONFIGURE_OPTIONS="--disable-static" |