diff --git a/configure.ac b/configure.ac
index 6cdcd28..e3f3c44 100644
a
|
b
|
fi |
142 | 142 | |
143 | 143 | AC_PROG_INSTALL |
144 | 144 | AC_CHECK_HEADERS([unistd.h string.h memory.h grp.h limits.h malloc.h \ |
145 | | stdlib.h termios.h utime.h fcntl.h pwd.h sys/statfs.h sys/vfs.h sys/time.h \ |
| 145 | stdlib.h termios.h utime.h fcntl.h pwd.h \ |
| 146 | sys/statfs.h sys/statvfs.h sys/vfs.h sys/time.h \ |
146 | 147 | sys/timeb.h sys/select.h sys/ioctl.h stropts.h arpa/inet.h \ |
147 | 148 | security/pam_misc.h sys/socket.h sys/sysmacros.h sys/types.h \ |
148 | 149 | sys/mkdev.h wchar.h wctype.h]) |
… |
… |
dnl |
198 | 199 | dnl This is from GNU fileutils, check aclocal.m4 for more information |
199 | 200 | dnl |
200 | 201 | AC_GET_FS_INFO |
| 202 | AC_CHECK_MEMBERS([struct statvfs.f_fstypename, struct statvfs.f_basetype],,,[ |
| 203 | AC_INCLUDES_DEFAULT |
| 204 | #include <sys/statvfs.h> |
| 205 | ]) |
201 | 206 | |
202 | 207 | dnl |
203 | 208 | dnl Missing typedefs and replacements |
diff --git a/src/filegui.c b/src/filegui.c
index 3544c50..1abb481 100644
a
|
b
|
|
55 | 55 | #include <sys/types.h> |
56 | 56 | #include <sys/stat.h> |
57 | 57 | |
58 | | #if defined (__FreeBSD__) |
| 58 | #if (STAT_STATVFS \ |
| 59 | && (HAVE_STRUCT_STATVFS_F_BASETYPE || HAVE_STRUCT_STATVFS_F_FSTYPENAME)) |
| 60 | # define USE_STATVFS 1 |
| 61 | # include <sys/statvfs.h> |
| 62 | # define STRUCT_STATFS struct statvfs |
| 63 | # define STATFS statvfs |
| 64 | #elif HAVE_STATFS && !STAT_STATFS4 |
| 65 | # define USE_STATFS 1 |
| 66 | # if HAVE_SYS_VFS_H |
| 67 | # include <sys/vfs.h> |
| 68 | # elif HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H |
59 | 69 | # include <sys/param.h> |
60 | | #endif |
61 | | #if defined(__APPLE__) || defined (__FreeBSD__) |
62 | 70 | # include <sys/mount.h> |
63 | | #elif defined (__NetBSD__) |
64 | | # include <sys/param.h> |
65 | | #else |
66 | | # ifdef HAVE_VFS |
67 | | # include <sys/vfs.h> |
68 | | # else |
69 | | # include <sys/statfs.h> |
70 | | # endif |
| 71 | # elif HAVE_SYS_STATFS_H |
| 72 | # include <sys/statfs.h> |
| 73 | # endif |
| 74 | # define STRUCT_STATFS struct statfs |
| 75 | # define STATFS statfs |
71 | 76 | #endif |
72 | 77 | |
73 | 78 | #include <unistd.h> |
… |
… |
enum { |
164 | 169 | static int |
165 | 170 | filegui__check_attrs_on_fs(const char *fs_path) |
166 | 171 | { |
167 | | struct statfs stfs; |
| 172 | #if USE_STATFS || USE_STATVFS |
| 173 | STRUCT_STATFS stfs; |
168 | 174 | |
169 | | if (statfs(fs_path, &stfs)!=0) |
| 175 | if (STATFS(fs_path, &stfs)!=0) |
170 | 176 | return 1; |
171 | 177 | |
| 178 | # ifdef __linux__ |
172 | 179 | switch ((filegui_nonattrs_fs_t) stfs.f_type) |
173 | 180 | { |
174 | 181 | case MSDOS_SUPER_MAGIC: |
… |
… |
filegui__check_attrs_on_fs(const char *fs_path) |
181 | 188 | return 0; |
182 | 189 | break; |
183 | 190 | } |
| 191 | # elif HAVE_STRUCT_STATFS_F_FSTYPENAME || HAVE_STRUCT_STATVFS_F_FSTYPENAME |
| 192 | if (!strcmp(stfs.f_fstypename, "msdos") |
| 193 | || !strcmp(stfs.f_fstypename, "msdosfs") |
| 194 | || !strcmp(stfs.f_fstypename, "ntfs") |
| 195 | || !strcmp(stfs.f_fstypename, "procfs") |
| 196 | || !strcmp(stfs.f_fstypename, "smbfs") |
| 197 | || strstr(stfs.f_fstypename, "fusefs")) |
| 198 | return 0; |
| 199 | # elif HAVE_STRUCT_STATVFS_F_BASETYPE |
| 200 | if (!strcmp(stfs.f_basetype, "pcfs") |
| 201 | || !strcmp(stfs.f_basetype, "ntfs") |
| 202 | || !strcmp(stfs.f_basetype, "proc") |
| 203 | || !strcmp(stfs.f_basetype, "smbfs") |
| 204 | || !strcmp(stfs.f_basetype, "fuse")) |
| 205 | return 0; |
| 206 | # endif |
| 207 | #endif /* USE_STATFS || USE_STATVFS */ |
| 208 | |
184 | 209 | return 1; |
185 | 210 | } |
186 | 211 | |