| Summary: | make assumes readdir returns '.' and '..' for the first two calls. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Jim.Pirzyk <Jim.Pirzyk> | ||||
| Component: | bin | Assignee: | Will Andrews <will> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 4.2-RELEASE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
Responsible Changed From-To: freebsd-bugs->will Over to maintainer State Changed From-To: open->suspended Merged into -CURRENT, where it will sit out for at least six weeks, since I don't have access to an environment like the one you describe (and thus your listdir program doesn't work the same way). I accepted your patch, however, because it appears to work correctly. State Changed From-To: suspended->closed Hmm, thought I closed this PR. Anyway, the fixed was MFC'd to RELENG_4 and RELENG_3 almost two weeks ago. |
The readdir on a specific NFS dir will not return '.' and '..' as the first entries. Make assumes that the first two calls to readdir will return those. The make fails because it cannot find the file 'S' (which is returned second, see below) How-To-Repeat: Running this short C program shows that '.' and '..' are not the first two entries returned by readdir. --- listdir.c --- #include <stdio.h> #include <sys/types.h> #include <dirent.h> void main (int argc, char *argv[]) { int i; for (i = 1; i < argc; i++) { (void)list_files (argv[i]); } } void list_files (char *dir) { DIR *d = opendir (dir); struct dirent *dp; if ( d ) { while (dp=readdir(d)) { printf ("%s\n", dp->d_name); } } else { printf ("Could not open %s\n", dir); } closedir(dir); } --- output from listdir (run by ./listdir /usr/src/contrib/groff/devX100 ) --- . S .. CB CI CR HB HI HR NB NI NR TB TI TR CBI HBI NBI TBI DESC