Skip to content

Commit bca4459

Browse files
committed
Merge pull request #1643 from ggouaillardet/topic/romio_openbsd57
io/romio: fix filesystem type check on OpenBSD
2 parents d5a2ac6 + b159587 commit bca4459

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

ompi/mca/io/romio314/romio/adio/common/ad_fstype.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro
346346
# endif
347347

348348

349+
# ifdef ROMIO_HAVE_STRUCT_STATFS_WITH_F_TYPE
350+
349351
#ifdef ROMIO_GPFS
350352
if (fsbuf.f_type == GPFS_SUPER_MAGIC) {
351353
*fstype = ADIO_GPFS;
@@ -413,6 +415,8 @@ static void ADIO_FileSysType_fncall(const char *filename, int *fstype, int *erro
413415
}
414416
# endif
415417

418+
# endif /*ROMIO_HAVE_STRUCT_STATFS_WITH_F_TYPE */
419+
416420
# ifdef ROMIO_UFS
417421
/* if UFS support is enabled, default to that */
418422
*fstype = ADIO_UFS;

ompi/mca/io/romio314/romio/configure.ac

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,11 +1360,53 @@ if test "$pac_cv_have_statfs" = yes ; then
13601360
AC_DEFINE(HAVE_STRUCT_STATFS,1,[Define if struct statfs can be compiled])
13611361
fi
13621362
1363+
AC_MSG_CHECKING([for f_type member of statfs structure])
1364+
AC_TRY_COMPILE([
1365+
#ifdef HAVE_SYS_VFS_H
1366+
#include <sys/vfs.h>
1367+
#endif
1368+
#ifdef HAVE_SYS_STATVFS_H
1369+
#include <sys/statvfs.h>
1370+
#endif
1371+
#ifdef HAVE_SYS_PARAM_H
1372+
#include <sys/param.h>
1373+
#endif
1374+
#ifdef HAVE_SYS_MOUNT_H
1375+
#include <sys/mount.h>
1376+
#endif
1377+
#ifdef HAVE_STRING_H
1378+
#include <string.h>
1379+
#endif
1380+
],[
1381+
struct statfs f;
1382+
memset(&f, 0, sizeof(f));
1383+
f.f_type = 0;
1384+
],
1385+
pac_cv_have_statfs_f_type=yes,
1386+
pac_cv_have_statfs_f_type=no
1387+
)
1388+
AC_MSG_RESULT($pac_cv_have_statfs_f_type)
1389+
if test $pac_cv_have_statfs_f_type = yes ; then
1390+
AC_DEFINE(ROMIO_HAVE_STRUCT_STATFS_WITH_F_TYPE, 1,[Define if statfs has f_type])
1391+
fi
1392+
13631393
AC_MSG_CHECKING([for f_fstypename member of statfs structure])
13641394
AC_TRY_COMPILE([
1395+
#ifdef HAVE_SYS_VFS_H
1396+
#include <sys/vfs.h>
1397+
#endif
1398+
#ifdef HAVE_SYS_STATVFS_H
1399+
#include <sys/statvfs.h>
1400+
#endif
1401+
#ifdef HAVE_SYS_PARAM_H
13651402
#include <sys/param.h>
1403+
#endif
1404+
#ifdef HAVE_SYS_MOUNT_H
13661405
#include <sys/mount.h>
1406+
#endif
1407+
#ifdef HAVE_STRING_H
13671408
#include <string.h>
1409+
#endif
13681410
],[
13691411
struct statfs f;
13701412
memset(&f, 0, sizeof(f));

0 commit comments

Comments
 (0)