diff options
author | Paul Smith <psmith@gnu.org> | 2000-02-07 19:54:04 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2000-02-07 19:54:04 +0000 |
commit | 17f2dda0acc8f97e40819d75d99d85283d9027a1 (patch) | |
tree | 1acbaedccd271a2346a75630a27b7c83e2aa5385 /dir.c | |
parent | 90f23f1ea6e436d681db81aa80edb7a763de2b12 (diff) | |
download | gunmake-17f2dda0acc8f97e40819d75d99d85283d9027a1.tar.gz |
* Fix for dir.c from Andreas Schwab.filedef-cleanup-base
* Fix += target-specific variables: if your direct parent doesn't have a
setting for the variable but his parent does, you'll get recursive
expansion errors.
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 27 |
1 files changed, 22 insertions, 5 deletions
@@ -1059,6 +1059,9 @@ read_dirstream (stream) #ifdef _DIRENT_HAVE_D_NAMLEN d->d_namlen = len - 1; #endif +#ifdef _DIRENT_HAVE_D_TYPE + d->d_type = DT_UNKNOWN; +#endif memcpy (d->d_name, df->name, len); return d; } @@ -1079,19 +1082,33 @@ ansi_free(p) free(p); } +/* On 64 bit ReliantUNIX (5.44 and above) in LFS mode, stat() is actually a + * macro for stat64(). If stat is a macro, make a local wrapper function to + * invoke it. + */ +#ifndef stat +# ifndef VMS +extern int stat (); +# endif +# define local_stat stat +#else +static int local_stat (path, buf) + char *path; + struct stat *buf; +{ + return stat (path, buf); +} +#endif + void dir_setup_glob (gl) glob_t *gl; { -#ifndef VMS - extern int stat (); -#endif - /* Bogus sunos4 compiler complains (!) about & before functions. */ gl->gl_opendir = open_dirstream; gl->gl_readdir = read_dirstream; gl->gl_closedir = ansi_free; - gl->gl_stat = stat; + 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. */ } |