summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-01-28 03:27:29 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-01-28 03:27:29 +0000
commit8df5b9cdd3494b1992f1411a9f5c8ad273814b91 (patch)
tree9b8dc8e4d7b25162f60030cfaf23cff7a54221e6
parent9d795b9a48d89b0a6f12d19d17d1cbe95e132b4e (diff)
downloadpackages-8df5b9cdd3494b1992f1411a9f5c8ad273814b91.tar.gz
packages-8df5b9cdd3494b1992f1411a9f5c8ad273814b91.tar.bz2
packages-8df5b9cdd3494b1992f1411a9f5c8ad273814b91.tar.xz
packages-8df5b9cdd3494b1992f1411a9f5c8ad273814b91.zip
system/musl: ensure dcngettext() preserves errno
-rw-r--r--system/musl/APKBUILD4
-rw-r--r--system/musl/gettext-preserve-errno.patch28
2 files changed, 31 insertions, 1 deletions
diff --git a/system/musl/APKBUILD b/system/musl/APKBUILD
index 368ba8766..1ab117c16 100644
--- a/system/musl/APKBUILD
+++ b/system/musl/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=musl
pkgver=1.1.21
-pkgrel=0
+pkgrel=1
pkgdesc="System library (libc) implementation"
url="http://www.musl-libc.org/"
arch="all"
@@ -26,6 +26,7 @@ source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
3001-make-real-lastlog-h.patch
handle-aux-at_base.patch
fgetspent_r.patch
+ gettext-preserve-errno.patch
ldconfig
getent.c
@@ -123,6 +124,7 @@ sha512sums="fa6c4cc012626c5e517e0e10926fc845e3aa5f863ffaceeb38ac5b9ce0af631a37f6
88ae443dbb8e0a4368235bdc3a1c5c7b718495afa75e06deb8e01becc76cb1f0d6964589e2204fc749c9c1b3190b8b9ac1ae2c0099cab8e2ce3ec877103d4332 3001-make-real-lastlog-h.patch
6a7ff16d95b5d1be77e0a0fbb245491817db192176496a57b22ab037637d97a185ea0b0d19da687da66c2a2f5578e4343d230f399d49fe377d8f008410974238 handle-aux-at_base.patch
ded41235148930f8cf781538f7d63ecb0c65ea4e8ce792565f3649ee2523592a76b2a166785f0b145fc79f5852fd1fb1729a7a09110b3b8f85cba3912e790807 fgetspent_r.patch
+db180e437b8b7582e4d2baf06b592b88a9f6e5a8f18b7afa81d7a707240a774273778f8fec1c5cbea2a137e00cca49ff08fe762c871be20c70b50104b7e8e1e1 gettext-preserve-errno.patch
cce2f1eeb61e55674469c26871a573cce61d739c3defe9c8f56f2b774f6ba5435849ad542a6714120efddc98c297098e9c98a1a424ac593df2243d4aa479f9a9 ldconfig
378d70e65bcc65bb4e1415354cecfa54b0c1146dfb24474b69e418cdbf7ad730472cd09f6f103e1c99ba6c324c9560bccdf287f5889bbc3ef0bdf0e08da47413 getent.c
9d42d66fb1facce2b85dad919be5be819ee290bd26ca2db00982b2f8e055a0196290a008711cbe2b18ec9eee8d2270e3b3a4692c5a1b807013baa5c2b70a2bbf iconv.c"
diff --git a/system/musl/gettext-preserve-errno.patch b/system/musl/gettext-preserve-errno.patch
new file mode 100644
index 000000000..c55df3e21
--- /dev/null
+++ b/system/musl/gettext-preserve-errno.patch
@@ -0,0 +1,28 @@
+diff --git a/src/locale/dcngettext.c b/src/locale/dcngettext.c
+index 8b891d00..4c304393 100644
+--- a/src/locale/dcngettext.c
++++ b/src/locale/dcngettext.c
+@@ -122,6 +122,7 @@ char *dcngettext(const char *domainname, const char *msgid1, const char *msgid2,
+ const struct __locale_map *lm;
+ size_t domlen;
+ struct binding *q;
++ int old_errno = errno;
+
+ if ((unsigned)category >= LC_ALL) goto notrans;
+
+@@ -138,6 +139,7 @@ char *dcngettext(const char *domainname, const char *msgid1, const char *msgid2,
+ lm = loc->cat[category];
+ if (!lm) {
+ notrans:
++ errno = old_errno;
+ return (char *) ((n == 1) ? msgid1 : msgid2);
+ }
+
+@@ -250,6 +252,7 @@ notrans:
+ trans += l+1;
+ }
+ }
++ errno = old_errno;
+ return (char *)trans;
+ }
+