diff options
author | Khem Raj <raj.khem@gmail.com> | 2019-01-31 10:11:44 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-02 11:05:59 +0000 |
commit | ba7731646ee1342d997310f9efe2629ac08401b3 (patch) | |
tree | dd11b91805bfe920c7cc96a9e737290fd1728a99 /meta/recipes-core/glibc/glibc/0024-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch | |
parent | bcb3e7b7f88adaabc7b78c7c0155b4f68da254d8 (diff) | |
download | poky-ba7731646ee1342d997310f9efe2629ac08401b3.tar.gz |
glibc: Update to 2.29 release
(From OE-Core rev: 9d9e055192bf1c66f2131482e6239e9c844ad0f4)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glibc/glibc/0024-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch')
-rw-r--r-- | meta/recipes-core/glibc/glibc/0024-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc/0024-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch b/meta/recipes-core/glibc/glibc/0024-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch new file mode 100644 index 0000000000..c289e544ee --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0024-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch | |||
@@ -0,0 +1,84 @@ | |||
1 | From b2d1c9b4159bfd661a4996588d06d922491dfecb Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 3 Aug 2018 09:42:06 -0700 | ||
4 | Subject: [PATCH 24/30] localedef --add-to-archive uses a hard-coded locale | ||
5 | path | ||
6 | |||
7 | it doesn't exist in normal use, and there's no way to pass an | ||
8 | alternative filename. | ||
9 | |||
10 | Add a fallback of $LOCALEARCHIVE from the environment, and allow | ||
11 | creation of new locale archives that are not the system archive. | ||
12 | |||
13 | Upstream-Status: Inappropriate (OE-specific) | ||
14 | |||
15 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
17 | --- | ||
18 | locale/programs/locarchive.c | 35 +++++++++++++++++++++++++---------- | ||
19 | 1 file changed, 25 insertions(+), 10 deletions(-) | ||
20 | |||
21 | diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c | ||
22 | index e6310b18be..f54a76eade 100644 | ||
23 | --- a/locale/programs/locarchive.c | ||
24 | +++ b/locale/programs/locarchive.c | ||
25 | @@ -340,12 +340,24 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head) | ||
26 | struct namehashent *oldnamehashtab; | ||
27 | struct locarhandle new_ah; | ||
28 | size_t prefix_len = output_prefix ? strlen (output_prefix) : 0; | ||
29 | - char archivefname[prefix_len + sizeof (ARCHIVE_NAME)]; | ||
30 | - char fname[prefix_len + sizeof (ARCHIVE_NAME) + sizeof (".XXXXXX") - 1]; | ||
31 | + char *archivefname; | ||
32 | + char *fname; | ||
33 | + char *envarchive = getenv("LOCALEARCHIVE"); | ||
34 | |||
35 | - if (output_prefix) | ||
36 | - memcpy (archivefname, output_prefix, prefix_len); | ||
37 | - strcpy (archivefname + prefix_len, ARCHIVE_NAME); | ||
38 | + if (envarchive != NULL) | ||
39 | + { | ||
40 | + archivefname = xmalloc(strlen(envarchive) + 1); | ||
41 | + fname = xmalloc(strlen(envarchive) + sizeof (".XXXXXX")); | ||
42 | + strcpy (archivefname, envarchive); | ||
43 | + } | ||
44 | + else | ||
45 | + { | ||
46 | + archivefname = xmalloc(prefix_len + sizeof (ARCHIVE_NAME)); | ||
47 | + fname = xmalloc(prefix_len + sizeof (ARCHIVE_NAME) + sizeof (".XXXXXX") - 1); | ||
48 | + if (output_prefix) | ||
49 | + memcpy (archivefname, output_prefix, prefix_len); | ||
50 | + strcpy (archivefname + prefix_len, ARCHIVE_NAME); | ||
51 | + } | ||
52 | strcpy (stpcpy (fname, archivefname), ".XXXXXX"); | ||
53 | |||
54 | /* Not all of the old file has to be mapped. Change this now this | ||
55 | @@ -569,10 +581,13 @@ open_archive (struct locarhandle *ah, bool readonly) | ||
56 | /* If ah has a non-NULL fname open that otherwise open the default. */ | ||
57 | if (archivefname == NULL) | ||
58 | { | ||
59 | - archivefname = default_fname; | ||
60 | - if (output_prefix) | ||
61 | - memcpy (default_fname, output_prefix, prefix_len); | ||
62 | - strcpy (default_fname + prefix_len, ARCHIVE_NAME); | ||
63 | + archivefname = getenv("LOCALEARCHIVE"); | ||
64 | + if (archivefname == NULL) { | ||
65 | + archivefname = default_fname; | ||
66 | + if (output_prefix) | ||
67 | + memcpy (default_fname, output_prefix, prefix_len); | ||
68 | + strcpy (default_fname + prefix_len, ARCHIVE_NAME); | ||
69 | + } | ||
70 | } | ||
71 | |||
72 | while (1) | ||
73 | @@ -585,7 +600,7 @@ open_archive (struct locarhandle *ah, bool readonly) | ||
74 | the default locale archive we ignore the failure and | ||
75 | list an empty archive, otherwise we print an error | ||
76 | and exit. */ | ||
77 | - if (errno == ENOENT && archivefname == default_fname) | ||
78 | + if (errno == ENOENT) | ||
79 | { | ||
80 | if (readonly) | ||
81 | { | ||
82 | -- | ||
83 | 2.20.1 | ||
84 | |||