From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1458015-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id A4E3A158003
	for <garchives@archives.gentoo.org>; Fri, 18 Nov 2022 17:59:23 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id E7AD6E0837;
	Fri, 18 Nov 2022 17:59:22 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id D1DF3E0837
	for <gentoo-commits@lists.gentoo.org>; Fri, 18 Nov 2022 17:59:22 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id E3274340FAD
	for <gentoo-commits@lists.gentoo.org>; Fri, 18 Nov 2022 17:59:21 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 593B575
	for <gentoo-commits@lists.gentoo.org>; Fri, 18 Nov 2022 17:59:20 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1668794342.39e348fad976c54d3980c2149de6365e8d035a4d.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-fs/lvm2/files/lvm2-2.03.16-musl-strerror_r.patch sys-fs/lvm2/lvm2-2.03.16-r2.ebuild
X-VCS-Directories: sys-fs/lvm2/files/ sys-fs/lvm2/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: 39e348fad976c54d3980c2149de6365e8d035a4d
X-VCS-Branch: master
Date: Fri, 18 Nov 2022 17:59:20 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 994c3dff-e9f1-48cc-9359-6433e84dad57
X-Archives-Hash: 56edfb6cd6bec619851629338d6f2858

commit:     39e348fad976c54d3980c2149de6365e8d035a4d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 18 17:59:02 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Nov 18 17:59:02 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39e348fa

sys-fs/lvm2: fix strerror_r check for musl

Closes: https://bugs.gentoo.org/869404
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../lvm2/files/lvm2-2.03.16-musl-strerror_r.patch  | 23 ++++++++++++++++++++++
 sys-fs/lvm2/lvm2-2.03.16-r2.ebuild                 |  1 +
 2 files changed, 24 insertions(+)

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"