1
1

Fixed issue with detecting root dir and used appropriate defines for solaris detection

This commit was SVN r22686.
Этот коммит содержится в:
Terry Dontje 2010-02-23 15:58:49 +00:00
родитель f79263550c
Коммит cfe37fb5a1

Просмотреть файл

@ -445,7 +445,7 @@ bool opal_path_nfs(char *fname)
int rc; int rc;
int trials; int trials;
char * file = strdup (fname); char * file = strdup (fname);
#if defined (__sun__) #if defined(__SVR4) && defined(__sun)
struct statvfs buf; struct statvfs buf;
#elif defined(linux) || defined (__BSD) || defined(__MACOSX__) #elif defined(linux) || defined (__BSD) || defined(__MACOSX__)
struct statfs buf; struct statfs buf;
@ -469,7 +469,7 @@ bool opal_path_nfs(char *fname)
again: again:
trials = 5; trials = 5;
do { do {
#if defined (__sun__) #if defined(__SVR4) && defined(__sun)
rc = statvfs (file, &buf); rc = statvfs (file, &buf);
#elif defined(linux) || defined (__BSD) || defined(__MACOSX__) #elif defined(linux) || defined (__BSD) || defined(__MACOSX__)
rc = statfs (file, &buf); rc = statfs (file, &buf);
@ -485,7 +485,8 @@ again:
last_sep = strrchr(file, OPAL_PATH_SEP[0]); last_sep = strrchr(file, OPAL_PATH_SEP[0]);
/* Stop the search, when we have searched past root '/' */ /* Stop the search, when we have searched past root '/' */
if (NULL == last_sep || '/' == *last_sep) { if (NULL == last_sep || (1 == strlen(last_sep) &&
OPAL_PATH_SEP[0] == last_sep)) {
free (file); free (file);
return false; return false;
} }
@ -495,7 +496,7 @@ again:
} }
/* Next, extract the magic value */ /* Next, extract the magic value */
#if defined (__sun__) #if defined(__SVR4) && defined(__sun)
for (i = 0; i < FS_TYPES_NUM; i++) for (i = 0; i < FS_TYPES_NUM; i++)
if (0 == strncasecmp (fs_types[i].f_fsname, buf.f_basetype, FSTYPSZ)) if (0 == strncasecmp (fs_types[i].f_fsname, buf.f_basetype, FSTYPSZ))
goto found; goto found;