Changeset 1075
- Timestamp:
- Jul 15, 2007, 8:22:00 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/dir.c
r1074 r1075 42 42 # endif /* HAVE_VMSDIR_H */ 43 43 #endif 44 /* bird: FreeBSD + smbfs -> readdir() + EBADF */ 45 #ifdef __FreeBSD__ 46 # include <sys/mount.h> 47 #endif 48 /* bird: end */ 44 49 45 50 /* In GNU systems, <dirent.h> defines this macro for us. */ … … 679 684 if (d == 0) 680 685 { 686 /* bird: Workaround for smbfs mounts returning EBADF at the end of the search. 687 To exactly determin the cause here, I should probably do some smbfs 688 tracing, but for now just ignoring the EBADF on seems to work. 689 (The smb server is 64-bit vista, btw.) */ 690 #if defined (__FreeBSD__) 691 struct statfs stfs; 692 int saved_errno = errno; 693 errno = 0; 694 if (saved_errno == EBADF 695 && !fstatfs (dirfd (dir->dirstream), &stfs) 696 && !(stfs.f_flags & MNT_LOCAL) 697 && !strcmp(stfs.f_fstypename, "smbfs")) 698 { 699 /*fprintf (stderr, "EBADF on remote fs! dirfd=%d errno=%d\n", 700 dirfd (dir->dirstream), errno);*/ 701 saved_errno = 0; 702 } 703 errno = saved_errno; 704 #endif 705 /* bird: end */ 681 706 if (errno) 682 707 fatal (NILF, "INTERNAL: readdir(%p): %s (filename=%s)\n", dir, strerror (errno), filename);
Note:
See TracChangeset
for help on using the changeset viewer.