Module Name:    src
Committed By:   nonaka
Date:           Mon Apr 30 04:17:27 UTC 2018

Modified Files:
        src/external/gpl2/gmake/dist: dir.c

Log Message:
gmake: Make this work with glibc glob interface v2

http://git.savannah.gnu.org/cgit/make.git/commit/?id=193f1e81


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/gmake/dist/dir.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/gmake/dist/dir.c
diff -u src/external/gpl2/gmake/dist/dir.c:1.1.1.1 src/external/gpl2/gmake/dist/dir.c:1.2
--- src/external/gpl2/gmake/dist/dir.c:1.1.1.1	Mon Aug 18 06:46:58 2014
+++ src/external/gpl2/gmake/dist/dir.c	Mon Apr 30 04:17:27 2018
@@ -1194,6 +1194,32 @@ local_stat (const char *path, struct sta
 }
 #endif
 
+/* Similarly for lstat.  */
+#if !defined(lstat) && !defined(WINDOWS32) || defined(VMS)
+# ifndef VMS
+#  ifndef HAVE_SYS_STAT_H
+int lstat (const char *path, struct stat *sbuf);
+#  endif
+# else
+    /* We are done with the fake lstat.  Go back to the real lstat */
+#   ifdef lstat
+#     undef lstat
+#   endif
+# endif
+# define local_lstat lstat
+#elif defined(WINDOWS32)
+/* Windows doesn't support lstat().  */
+# define local_lstat local_stat
+#else
+static int
+local_lstat (const char *path, struct stat *buf)
+{
+  int e;
+  EINTRLOOP (e, lstat (path, buf));
+  return e;
+}
+#endif
+
 void
 dir_setup_glob (glob_t *gl)
 {
@@ -1201,9 +1227,8 @@ dir_setup_glob (glob_t *gl)
   gl->gl_opendir = open_dirstream;
   gl->gl_readdir = read_dirstream;
   gl->gl_closedir = ansi_free;
+  gl->gl_lstat = local_lstat;
   gl->gl_stat = local_stat;
-  /* We don't bother setting gl_lstat, since glob never calls it.
-     The slot is only there for compatibility with 4.4 BSD.  */
 }
 
 void

Reply via email to