chiark / gitweb /
eglibc (2.11.3-4+deb6u3) squeeze-lts; urgency=medium
[eglibc.git] / debian / patches / any / local-ldconfig.diff
1 # DP: Make it so that a missing /etc/ld.so.conf does not cause an error
2 # DP: message, unless --verbose is enabled. This keeps the debian
3 # DP: installer from barfing during bootstrap of the system.
4 # DP:
5 # DP: Updated by gotom, the previous one seems being wrong because it supresses
6 # DP: _all_ warnings about "can't open configuration file". otoh, I introduce
7 # DP: newer patches.  it should be checked using chroot and should be contacted
8 # DP: to the upstream.
9 # DP: Date: (Updated 2005-01-02 gotom)
10
11 # previous patch.
12 #--- elf/ldconfig.c     2003-07-08 23:26:27.000000000 +0900
13 #+++ elf/ldconfig.c.debian      2003-07-08 23:29:43.000000000 +0900
14 #@@ -920,26 +920,24 @@
15 # {
16 #   FILE *file = NULL;
17 #   char *line = NULL;
18 #-  const char *canon;
19 #+  const char *canon = filename;
20 #   size_t len = 0;
21 #+  int file_fd;
22
23 #   if (opt_chroot)
24 #     {
25 #       canon = chroot_canon (opt_chroot, filename);
26 #-      if (canon)
27 #-      file = fopen (canon, "r");
28 #-      else
29 #+      if (!canon)
30 #       canon = filename;
31 #     }
32 #-  else
33 #-    {
34 #-      canon = filename;
35 #-      file = fopen (filename, "r");
36 #-    }
37 #+
38 #+  if ((file_fd = open(canon, O_RDONLY | O_EXCL, 0022)) != -1)
39 #+    file = fdopen (file_fd, "r");
40
41 #   if (file == NULL)
42 #     {
43 #-      error (0, errno, _("Can't open configuration file %s"), canon);
44 #+      if (opt_verbose)
45 #+      error (0, errno, _("Can't open configuration file %s"), canon);
46 #       if (canon != filename)
47 #       free ((char *) canon);
48 #       return;
49
50 2004-10-25  GOTO Masanori  <gotom@debian.or.jp>
51
52         * elf/ldconfig.c: Don't print error when default ld.so.conf
53           is not existed.
54
55 ---
56  elf/ldconfig.c |    3 ++-
57  1 file changed, 2 insertions(+), 1 deletion(-)
58
59 --- a/elf/ldconfig.c
60 +++ b/elf/ldconfig.c
61 @@ -1066,7 +1066,8 @@
62  
63    if (file == NULL)
64      {
65 -      error (0, errno, _("Can't open configuration file %s"), canon);
66 +      if (strcmp(canon, LD_SO_CONF) != 0 || opt_verbose)
67 +       error (0, errno, _("Can't open configuration file %s"), canon);
68        if (canon != filename)
69         free ((char *) canon);
70        return;