From: "Jory Pratt" <anarchy@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/, sys-libs/musl/
Date: Mon, 16 Aug 2021 00:59:13 +0000 (UTC) [thread overview]
Message-ID: <1629075549.2dab1e0a3d9d88883019be43fa70b85d29c30338.anarchy@gentoo> (raw)
commit: 2dab1e0a3d9d88883019be43fa70b85d29c30338
Author: Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 16 00:55:49 2021 +0000
Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Mon Aug 16 00:59:09 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2dab1e0a
sys-libs/musl: extend gethostid for zfs users
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>
sys-libs/musl/files/musl-1.2.2-gethostid.patch | 43 ++++++++++++++++++++++
.../{musl-1.2.2-r2.ebuild => musl-1.2.2-r3.ebuild} | 7 ++++
2 files changed, 50 insertions(+)
diff --git a/sys-libs/musl/files/musl-1.2.2-gethostid.patch b/sys-libs/musl/files/musl-1.2.2-gethostid.patch
new file mode 100644
index 00000000000..96c799cfca2
--- /dev/null
+++ b/sys-libs/musl/files/musl-1.2.2-gethostid.patch
@@ -0,0 +1,43 @@
+Subject: [musl] [PATCH] extend gethostid beyond a stub
+Archived-At: <https://inbox.vuxu.org/musl/20210420191519.23822-3-ericonr@disroot.org/>
+List-Archive: <https://inbox.vuxu.org/musl/>
+List-Post: <mailto:musl@inbox.vuxu.org>
+
+From: Érico Rolim <erico.erc@gmail.com>
+
+Implement part of the glibc behavior, where the 32-bit identifier stored
+in /etc/hostid, if the file exists, is returned. If this file doesn't
+contain at least 32 bits or can't be opened for some reason, return 0.
+---
+ src/misc/gethostid.c | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/src/misc/gethostid.c b/src/misc/gethostid.c
+index 25bb35db..d529de9c 100644
+--- a/src/misc/gethostid.c
++++ b/src/misc/gethostid.c
+@@ -1,6 +1,19 @@
+ #include <unistd.h>
++#include <stdio.h>
++#include <stdint.h>
+
+ long gethostid()
+ {
+- return 0;
++ FILE *f;
++ int32_t rv = 0;
++
++ f = fopen("/etc/hostid", "reb");
++ if (f) {
++ if (fread(&rv, sizeof(rv), 1, f) == 0) {
++ rv = 0;
++ }
++ fclose(f);
++ }
++
++ return rv;
+ }
+--
+2.31.1
+
+
diff --git a/sys-libs/musl/musl-1.2.2-r2.ebuild b/sys-libs/musl/musl-1.2.2-r3.ebuild
similarity index 96%
rename from sys-libs/musl/musl-1.2.2-r2.ebuild
rename to sys-libs/musl/musl-1.2.2-r3.ebuild
index 905348ba854..465a763222d 100644
--- a/sys-libs/musl/musl-1.2.2-r2.ebuild
+++ b/sys-libs/musl/musl-1.2.2-r3.ebuild
@@ -71,6 +71,13 @@ src_unpack() {
cp "${DISTDIR}"/iconv.c misc/iconv.c || die
}
+src_prepare() {
+ default
+
+ # Expand gethostid instead of being just a stub
+ eapply "${FILESDIR}/${PN}-1.2.2-gethostid.patch"
+}
+
src_configure() {
tc-getCC ${CTARGET}
just_headers && export CC=true
next reply other threads:[~2021-08-16 20:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-16 0:59 Jory Pratt [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-01-14 2:32 [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/, sys-libs/musl/ Sam James
2021-11-22 13:58 Sam James
2021-11-19 3:03 Sam James
2020-11-24 15:00 Sam James
2016-02-16 23:22 Anthony G. Basile
2015-10-21 19:20 Anthony G. Basile
2015-09-08 19:46 Anthony G. Basile
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1629075549.2dab1e0a3d9d88883019be43fa70b85d29c30338.anarchy@gentoo \
--to=anarchy@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox