diff --git a/packages/seacas/libraries/ioss/src/Ioss_FileInfo.C b/packages/seacas/libraries/ioss/src/Ioss_FileInfo.C index a8959a10ef..3f26bafadf 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_FileInfo.C +++ b/packages/seacas/libraries/ioss/src/Ioss_FileInfo.C @@ -172,19 +172,16 @@ namespace Ioss { //: Return TRUE if file is on an NFS filesystem... bool FileInfo::is_nfs() const { -#if !defined(__IOSS_WINDOWS__) -#define NFS_FS 0x6969 /* statfs defines that 0x6969 is NFS filesystem */ +#if defined(__IOSS_WINDOWS__) + return false; +#else auto tmp_path = pathname(); if (tmp_path.empty()) { char *current_cwd = getcwd(nullptr, 0); tmp_path = std::string(current_cwd); free(current_cwd); } -#if defined(__IOSS_WINDOWS__) - char *path = _fullpath(nullptr, tmp_path.c_str(), _MAX_PATH); -#else char *path = ::realpath(tmp_path.c_str(), nullptr); -#endif if (path != nullptr) { struct statfs stat_fs; @@ -196,10 +193,14 @@ namespace Ioss { IOSS_ERROR(errmsg); } free(path); - return (stat_fs.f_type == NFS_FS); - } + +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) + return (0 == ::strcmp("nfs", stat_fs.f_fstypename)); +#else + /* linux statfs defines that 0x6969 is NFS filesystem */ + return (stat_fs.f_type == 0x6969); #endif - return false; + } } //: Time of last data modification. See 'man stat(2)'