mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
2.8 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/glibc/glibc22/ldconfig-glob.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2005 Clifford Wolf
  10. #
  11. # This patch file is dual-licensed. It is available under the license the
  12. # patched project is licensed under, as long as it is an OpenSource license
  13. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  14. # of the GNU General Public License as published by the Free Software
  15. # Foundation; either version 2 of the License, or (at your option) any later
  16. # version.
  17. #
  18. # --- ROCK-COPYRIGHT-NOTE-END ---
  19. --- ./elf/ldconfig.c.orig 2002-09-14 12:12:51.000000000 +0200
  20. +++ ./elf/ldconfig.c 2002-09-14 12:52:50.000000000 +0200
  21. @@ -23,6 +23,7 @@
  22. #include <elf.h>
  23. #include <error.h>
  24. #include <errno.h>
  25. +#include <glob.h>
  26. #include <inttypes.h>
  27. #include <libintl.h>
  28. #include <stdio.h>
  29. @@ -302,8 +303,10 @@
  30. {
  31. char *equal_sign;
  32. struct dir_entry *entry;
  33. + struct dir_entry *real_entry;
  34. unsigned int i;
  35. struct stat64 stat_buf;
  36. + glob_t globres;
  37. entry = xmalloc (sizeof (struct dir_entry));
  38. entry->next = NULL;
  39. @@ -338,19 +341,50 @@
  40. --i;
  41. }
  42. - if (stat64 (entry->path, &stat_buf))
  43. - {
  44. - if (opt_verbose)
  45. - error (0, errno, _("Can't stat %s"), entry->path);
  46. - free (entry->path);
  47. - free (entry);
  48. - return;
  49. - }
  50. + if ( glob(entry->path, GLOB_ONLYDIR, NULL, &globres) == 0 )
  51. + {
  52. + for (i=0; i<globres.gl_pathc; i++)
  53. + {
  54. + real_entry = xmalloc (sizeof (struct dir_entry));
  55. + memcpy (real_entry, entry, sizeof (struct dir_entry));
  56. + real_entry->path = xstrdup (globres.gl_pathv[i]);
  57. - entry->ino = stat_buf.st_ino;
  58. - entry->dev = stat_buf.st_dev;
  59. + if (stat64 (real_entry->path, &stat_buf))
  60. + {
  61. + if (opt_verbose)
  62. + error (0, errno, _("Can't stat %s"), real_entry->path);
  63. + free (real_entry->path);
  64. + free (real_entry);
  65. + }
  66. + else
  67. + {
  68. + real_entry->ino = stat_buf.st_ino;
  69. + real_entry->dev = stat_buf.st_dev;
  70. +
  71. + add_single_dir (real_entry, 1);
  72. + }
  73. + }
  74. + globfree (&globres);
  75. + free (entry->path);
  76. + free (entry);
  77. + }
  78. + else
  79. + {
  80. + if (stat64 (entry->path, &stat_buf))
  81. + {
  82. + if (opt_verbose)
  83. + error (0, errno, _("Can't stat %s"), entry->path);
  84. + free (entry->path);
  85. + free (entry);
  86. + }
  87. + else
  88. + {
  89. + entry->ino = stat_buf.st_ino;
  90. + entry->dev = stat_buf.st_dev;
  91. - add_single_dir (entry, 1);
  92. + add_single_dir (entry, 1);
  93. + }
  94. + }
  95. }