about summary refs log tree commit diff
path: root/pkgs/development/libraries/glibc-2.10/locale-override.patch
blob: 108d0e35dacf0b364890da5ca136ceae8c6404ca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
diff -rc glibc-2.9-20081208-orig/locale/loadarchive.c glibc-2.9-20081208/locale/loadarchive.c
*** glibc-2.9-20081208-orig/locale/loadarchive.c	2005-09-09 18:56:52.000000000 +0200
--- glibc-2.9-20081208/locale/loadarchive.c	2009-04-19 13:54:26.000000000 +0200
***************
*** 124,129 ****
--- 124,142 ----
  }
  
  
+ static int
+ open_locale_archive ()
+ {
+   int fd = -1;
+   char *path = getenv ("LOCALE_ARCHIVE");
+   if (path)
+     fd = open_not_cancel_2 (path, O_RDONLY|O_LARGEFILE);
+   if (fd < 0)
+     fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
+   return fd;
+ }
+ 
+ 
  /* Find the locale *NAMEP in the locale archive, and return the
     internalized data structure for its CATEGORY data.  If this locale has
     already been loaded from the archive, just returns the existing data
***************
*** 203,209 ****
        archmapped = &headmap;
  
        /* The archive has never been opened.  */
!       fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
        if (fd < 0)
  	/* Cannot open the archive, for whatever reason.  */
  	return NULL;
--- 216,222 ----
        archmapped = &headmap;
  
        /* The archive has never been opened.  */
!       fd = open_locale_archive ();
        if (fd < 0)
  	/* Cannot open the archive, for whatever reason.  */
  	return NULL;
***************
*** 394,400 ****
  	  if (fd == -1)
  	    {
  	      struct stat64 st;
! 	      fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
  	      if (fd == -1)
  		/* Cannot open the archive, for whatever reason.  */
  		return NULL;
--- 407,413 ----
  	  if (fd == -1)
  	    {
  	      struct stat64 st;
! 	      fd = open_locale_archive ();
  	      if (fd == -1)
  		/* Cannot open the archive, for whatever reason.  */
  		return NULL;
diff -rc glibc-2.9-20081208-orig/sysdeps/generic/unsecvars.h glibc-2.9-20081208/sysdeps/generic/unsecvars.h
*** glibc-2.9-20081208-orig/sysdeps/generic/unsecvars.h	2006-10-11 18:24:05.000000000 +0200
--- glibc-2.9-20081208/sysdeps/generic/unsecvars.h	2009-04-19 13:55:34.000000000 +0200
***************
*** 16,21 ****
--- 16,22 ----
    "LD_SHOW_AUXV\0"							      \
    "LD_USE_LOAD_BIAS\0"							      \
    "LOCALDOMAIN\0"							      \
+   "LOCALE_ARCHIVE\0"							      \
    "LOCPATH\0"								      \
    "MALLOC_TRACE\0"							      \
    "NIS_PATH\0"								      \