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.

105 lines
2.9 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/glibc23/ldconfig-glob.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. --- ./elf/ldconfig.c.orig 2002-09-14 12:12:51.000000000 +0200
  23. +++ ./elf/ldconfig.c 2002-09-14 12:52:50.000000000 +0200
  24. @@ -23,6 +23,7 @@
  25. #include <elf.h>
  26. #include <error.h>
  27. #include <errno.h>
  28. +#include <glob.h>
  29. #include <inttypes.h>
  30. #include <libintl.h>
  31. #include <stdio.h>
  32. @@ -302,8 +303,10 @@
  33. {
  34. char *equal_sign;
  35. struct dir_entry *entry;
  36. + struct dir_entry *real_entry;
  37. unsigned int i;
  38. struct stat64 stat_buf;
  39. + glob_t globres;
  40. entry = xmalloc (sizeof (struct dir_entry));
  41. entry->next = NULL;
  42. @@ -338,19 +341,50 @@
  43. --i;
  44. }
  45. - if (stat64 (entry->path, &stat_buf))
  46. - {
  47. - if (opt_verbose)
  48. - error (0, errno, _("Can't stat %s"), entry->path);
  49. - free (entry->path);
  50. - free (entry);
  51. - return;
  52. - }
  53. + if ( glob(entry->path, GLOB_ONLYDIR, NULL, &globres) == 0 )
  54. + {
  55. + for (i=0; i<globres.gl_pathc; i++)
  56. + {
  57. + real_entry = xmalloc (sizeof (struct dir_entry));
  58. + memcpy (real_entry, entry, sizeof (struct dir_entry));
  59. + real_entry->path = xstrdup (globres.gl_pathv[i]);
  60. - entry->ino = stat_buf.st_ino;
  61. - entry->dev = stat_buf.st_dev;
  62. + if (stat64 (real_entry->path, &stat_buf))
  63. + {
  64. + if (opt_verbose)
  65. + error (0, errno, _("Can't stat %s"), real_entry->path);
  66. + free (real_entry->path);
  67. + free (real_entry);
  68. + }
  69. + else
  70. + {
  71. + real_entry->ino = stat_buf.st_ino;
  72. + real_entry->dev = stat_buf.st_dev;
  73. +
  74. + add_single_dir (real_entry, 1);
  75. + }
  76. + }
  77. + globfree (&globres);
  78. + free (entry->path);
  79. + free (entry);
  80. + }
  81. + else
  82. + {
  83. + if (stat64 (entry->path, &stat_buf))
  84. + {
  85. + if (opt_verbose)
  86. + error (0, errno, _("Can't stat %s"), entry->path);
  87. + free (entry->path);
  88. + free (entry);
  89. + }
  90. + else
  91. + {
  92. + entry->ino = stat_buf.st_ino;
  93. + entry->dev = stat_buf.st_dev;
  94. - add_single_dir (entry, 1);
  95. + add_single_dir (entry, 1);
  96. + }
  97. + }
  98. }