io/romio: fix filesystem type check on OpenBSD 5.7
check the existence of the f_type field in struct statfs Thanks Paul Hargrove for the report
Этот коммит содержится в:
родитель
1911d74095
Коммит
b159587325
@ -346,6 +346,8 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
|
||||||
|
# ifdef ROMIO_HAVE_STRUCT_STATFS_WITH_F_TYPE
|
||||||
|
|
||||||
#ifdef ROMIO_GPFS
|
#ifdef ROMIO_GPFS
|
||||||
if (fsbuf.f_type == GPFS_SUPER_MAGIC) {
|
if (fsbuf.f_type == GPFS_SUPER_MAGIC) {
|
||||||
*fstype = ADIO_GPFS;
|
*fstype = ADIO_GPFS;
|
||||||
@ -413,6 +415,8 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro
|
|||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# endif /*ROMIO_HAVE_STRUCT_STATFS_WITH_F_TYPE */
|
||||||
|
|
||||||
# ifdef ROMIO_UFS
|
# ifdef ROMIO_UFS
|
||||||
/* if UFS support is enabled, default to that */
|
/* if UFS support is enabled, default to that */
|
||||||
*fstype = ADIO_UFS;
|
*fstype = ADIO_UFS;
|
||||||
|
@ -1360,11 +1360,53 @@ if test "$pac_cv_have_statfs" = yes ; then
|
|||||||
AC_DEFINE(HAVE_STRUCT_STATFS,1,[Define if struct statfs can be compiled])
|
AC_DEFINE(HAVE_STRUCT_STATFS,1,[Define if struct statfs can be compiled])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([for f_type member of statfs structure])
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
#ifdef HAVE_SYS_VFS_H
|
||||||
|
#include <sys/vfs.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_STATVFS_H
|
||||||
|
#include <sys/statvfs.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_PARAM_H
|
||||||
|
#include <sys/param.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_MOUNT_H
|
||||||
|
#include <sys/mount.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_STRING_H
|
||||||
|
#include <string.h>
|
||||||
|
#endif
|
||||||
|
],[
|
||||||
|
struct statfs f;
|
||||||
|
memset(&f, 0, sizeof(f));
|
||||||
|
f.f_type = 0;
|
||||||
|
],
|
||||||
|
pac_cv_have_statfs_f_type=yes,
|
||||||
|
pac_cv_have_statfs_f_type=no
|
||||||
|
)
|
||||||
|
AC_MSG_RESULT($pac_cv_have_statfs_f_type)
|
||||||
|
if test $pac_cv_have_statfs_f_type = yes ; then
|
||||||
|
AC_DEFINE(ROMIO_HAVE_STRUCT_STATFS_WITH_F_TYPE, 1,[Define if statfs has f_type])
|
||||||
|
fi
|
||||||
|
|
||||||
AC_MSG_CHECKING([for f_fstypename member of statfs structure])
|
AC_MSG_CHECKING([for f_fstypename member of statfs structure])
|
||||||
AC_TRY_COMPILE([
|
AC_TRY_COMPILE([
|
||||||
|
#ifdef HAVE_SYS_VFS_H
|
||||||
|
#include <sys/vfs.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_STATVFS_H
|
||||||
|
#include <sys/statvfs.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_PARAM_H
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_MOUNT_H
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_STRING_H
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#endif
|
||||||
],[
|
],[
|
||||||
struct statfs f;
|
struct statfs f;
|
||||||
memset(&f, 0, sizeof(f));
|
memset(&f, 0, sizeof(f));
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user