Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / patches / make-glibc-compat.patch
1 Work with the new glob interface in glibc 2.27.
2
3 Taken from this upstream commit:
4 https://git.savannah.gnu.org/cgit/make.git/commit/?id=193f1e81edd6b1b56b0eb0ff8aa4b41c7b4257b4
5
6 diff --git a/dir.c b/dir.c
7 index adbb8a9..c343e4c 100644
8 --- a/dir.c
9 +++ b/dir.c
10 @@ -1299,15 +1299,40 @@ local_stat (const char *path, struct stat *buf)
11 }
12 #endif
13
14 +/* Similarly for lstat. */
15 +#if !defined(lstat) && !defined(WINDOWS32) || defined(VMS)
16 +# ifndef VMS
17 +# ifndef HAVE_SYS_STAT_H
18 +int lstat (const char *path, struct stat *sbuf);
19 +# endif
20 +# else
21 + /* We are done with the fake lstat. Go back to the real lstat */
22 +# ifdef lstat
23 +# undef lstat
24 +# endif
25 +# endif
26 +# define local_lstat lstat
27 +#elif defined(WINDOWS32)
28 +/* Windows doesn't support lstat(). */
29 +# define local_lstat local_stat
30 +#else
31 +static int
32 +local_lstat (const char *path, struct stat *buf)
33 +{
34 + int e;
35 + EINTRLOOP (e, lstat (path, buf));
36 + return e;
37 +}
38 +#endif
39 +
40 void
41 dir_setup_glob (glob_t *gl)
42 {
43 gl->gl_opendir = open_dirstream;
44 gl->gl_readdir = read_dirstream;
45 gl->gl_closedir = free;
46 + gl->gl_lstat = local_lstat;
47 gl->gl_stat = local_stat;
48 - /* We don't bother setting gl_lstat, since glob never calls it.
49 - The slot is only there for compatibility with 4.4 BSD. */
50 }
51
52 void