summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/make/make/0001-glob-Do-not-assume-glibc-glob-internals.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/make/make/0001-glob-Do-not-assume-glibc-glob-internals.patch')
-rw-r--r--meta/recipes-devtools/make/make/0001-glob-Do-not-assume-glibc-glob-internals.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/meta/recipes-devtools/make/make/0001-glob-Do-not-assume-glibc-glob-internals.patch b/meta/recipes-devtools/make/make/0001-glob-Do-not-assume-glibc-glob-internals.patch
new file mode 100644
index 0000000000..5839d2ddd1
--- /dev/null
+++ b/meta/recipes-devtools/make/make/0001-glob-Do-not-assume-glibc-glob-internals.patch
@@ -0,0 +1,69 @@
1From c90a7dda6c572f79b8e78da44b6ebf8704edef65 Mon Sep 17 00:00:00 2001
2From: Paul Eggert <eggert@cs.ucla.edu>
3Date: Sun, 24 Sep 2017 09:12:58 -0400
4Subject: [PATCH 1/2] glob: Do not assume glibc glob internals.
5
6It has been proposed that glibc glob start using gl_lstat,
7which the API allows it to do. GNU 'make' should not get in
8the way of this. See:
9https://sourceware.org/ml/libc-alpha/2017-09/msg00409.html
10
11* dir.c (local_lstat): New function, like local_stat.
12(dir_setup_glob): Use it to initialize gl_lstat too, as the API
13requires.
14---
15Upstream-Status: Backport
16
17 dir.c | 29 +++++++++++++++++++++++++++--
18 1 file changed, 27 insertions(+), 2 deletions(-)
19
20diff --git a/dir.c b/dir.c
21index f34bbf5..12eef30 100644
22--- a/dir.c
23+++ b/dir.c
24@@ -1299,15 +1299,40 @@ local_stat (const char *path, struct stat *buf)
25 }
26 #endif
27
28+/* Similarly for lstat. */
29+#if !defined(lstat) && !defined(WINDOWS32) || defined(VMS)
30+# ifndef VMS
31+# ifndef HAVE_SYS_STAT_H
32+int lstat (const char *path, struct stat *sbuf);
33+# endif
34+# else
35+ /* We are done with the fake lstat. Go back to the real lstat */
36+# ifdef lstat
37+# undef lstat
38+# endif
39+# endif
40+# define local_lstat lstat
41+#elif defined(WINDOWS32)
42+/* Windows doesn't support lstat(). */
43+# define local_lstat local_stat
44+#else
45+static int
46+local_lstat (const char *path, struct stat *buf)
47+{
48+ int e;
49+ EINTRLOOP (e, lstat (path, buf));
50+ return e;
51+}
52+#endif
53+
54 void
55 dir_setup_glob (glob_t *gl)
56 {
57 gl->gl_opendir = open_dirstream;
58 gl->gl_readdir = read_dirstream;
59 gl->gl_closedir = free;
60+ gl->gl_lstat = local_lstat;
61 gl->gl_stat = local_stat;
62- /* We don't bother setting gl_lstat, since glob never calls it.
63- The slot is only there for compatibility with 4.4 BSD. */
64 }
65
66 void
67--
682.16.1
69