lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 22.05-pre 118 lines 3.7 kB view raw
1diff -Naur glibc-2.27-orig/locale/loadarchive.c glibc-2.27/locale/loadarchive.c 2--- glibc-2.27-orig/locale/loadarchive.c 2018-02-01 11:17:18.000000000 -0500 3+++ glibc-2.27/locale/loadarchive.c 2018-02-17 22:32:25.680169462 -0500 4@@ -123,6 +123,23 @@ 5 return MAX (namehash_end, MAX (string_end, locrectab_end)); 6 } 7 8+static int 9+open_locale_archive (void) 10+{ 11+ int fd = -1; 12+ char *versioned_path = getenv ("LOCALE_ARCHIVE_2_27"); 13+ char *path = getenv ("LOCALE_ARCHIVE"); 14+ if (versioned_path) 15+ fd = __open_nocancel (versioned_path, O_RDONLY|O_LARGEFILE|O_CLOEXEC); 16+ if (path && fd < 0) 17+ fd = __open_nocancel (path, O_RDONLY|O_LARGEFILE|O_CLOEXEC); 18+ if (fd < 0) 19+ fd = __open_nocancel (archfname, O_RDONLY|O_LARGEFILE|O_CLOEXEC); 20+ if (fd < 0) 21+ fd = __open_nocancel ("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE|O_CLOEXEC); 22+ return fd; 23+} 24+ 25 26 /* Find the locale *NAMEP in the locale archive, and return the 27 internalized data structure for its CATEGORY data. If this locale has 28@@ -202,7 +219,7 @@ 29 archmapped = &headmap; 30 31 /* The archive has never been opened. */ 32- fd = __open_nocancel (archfname, O_RDONLY|O_LARGEFILE|O_CLOEXEC); 33+ fd = open_locale_archive (); 34 if (fd < 0) 35 /* Cannot open the archive, for whatever reason. */ 36 return NULL; 37@@ -397,8 +414,7 @@ 38 if (fd == -1) 39 { 40 struct stat64 st; 41- fd = __open_nocancel (archfname, 42- O_RDONLY|O_LARGEFILE|O_CLOEXEC); 43+ fd = open_locale_archive (); 44 if (fd == -1) 45 /* Cannot open the archive, for whatever reason. */ 46 return NULL; 47diff -Naur glibc-2.27-orig/locale/programs/locale.c glibc-2.27/locale/programs/locale.c 48--- glibc-2.27-orig/locale/programs/locale.c 2018-02-01 11:17:18.000000000 -0500 49+++ glibc-2.27/locale/programs/locale.c 2018-02-17 22:36:39.726293213 -0500 50@@ -633,6 +633,24 @@ 51 52 53 static int 54+open_locale_archive (void) 55+{ 56+ int fd = -1; 57+ char *versioned_path = getenv ("LOCALE_ARCHIVE_2_27"); 58+ char *path = getenv ("LOCALE_ARCHIVE"); 59+ if (versioned_path) 60+ fd = open64 (versioned_path, O_RDONLY); 61+ if (path && fd < 0) 62+ fd = open64 (path, O_RDONLY); 63+ if (fd < 0) 64+ fd = open64 (ARCHIVE_NAME, O_RDONLY); 65+ if (fd < 0) 66+ fd = open64 ("/usr/lib/locale/locale-archive", O_RDONLY); 67+ return fd; 68+} 69+ 70+ 71+static int 72 write_archive_locales (void **all_datap, char *linebuf) 73 { 74 struct stat64 st; 75@@ -644,7 +662,7 @@ 76 int fd, ret = 0; 77 uint32_t cnt; 78 79- fd = open64 (ARCHIVE_NAME, O_RDONLY); 80+ fd = open_locale_archive (); 81 if (fd < 0) 82 return 0; 83 84diff -Naur glibc-2.27-orig/locale/programs/locarchive.c glibc-2.27/locale/programs/locarchive.c 85--- glibc-2.27-orig/locale/programs/locarchive.c 2018-02-01 11:17:18.000000000 -0500 86+++ glibc-2.27/locale/programs/locarchive.c 2018-02-17 22:40:51.245293975 -0500 87@@ -117,6 +117,22 @@ 88 } 89 90 91+static int 92+open_locale_archive (const char * archivefname, int flags) 93+{ 94+ int fd = -1; 95+ char *versioned_path = getenv ("LOCALE_ARCHIVE_2_27"); 96+ char *path = getenv ("LOCALE_ARCHIVE"); 97+ if (versioned_path) 98+ fd = open64 (versioned_path, flags); 99+ if (path && fd < 0) 100+ fd = open64 (path, flags); 101+ if (fd < 0) 102+ fd = open64 (archivefname, flags); 103+ return fd; 104+} 105+ 106+ 107 static void 108 create_archive (const char *archivefname, struct locarhandle *ah) 109 { 110@@ -578,7 +594,7 @@ 111 while (1) 112 { 113 /* Open the archive. We must have exclusive write access. */ 114- fd = open64 (archivefname, readonly ? O_RDONLY : O_RDWR); 115+ fd = open_locale_archive (archivefname, readonly ? O_RDONLY : O_RDWR); 116 if (fd == -1) 117 { 118 /* Maybe the file does not yet exist? If we are opening