opal_path_nfs test: do not try to test filesystems that can not be stat'd
Этот коммит содержится в:
родитель
9cb3e7d181
Коммит
0fc8777aa8
@ -1,3 +1,4 @@
|
|||||||
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||||
* University Research and Technology
|
* University Research and Technology
|
||||||
@ -13,6 +14,8 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2010 IBM Corporation. All rights reserved.
|
* Copyright (c) 2010 IBM Corporation. All rights reserved.
|
||||||
|
* Copyright (c) 2014 Los Alamos National Security, LLC. All rights
|
||||||
|
* reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -27,6 +30,9 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <sys/mount.h>
|
||||||
|
|
||||||
#include "support.h"
|
#include "support.h"
|
||||||
#include "opal/util/path.h"
|
#include "opal/util/path.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
@ -129,6 +135,7 @@ void get_mounts (int * num_dirs, char ** dirs[], bool * nfs[])
|
|||||||
char ** dirs_tmp;
|
char ** dirs_tmp;
|
||||||
bool * nfs_tmp;
|
bool * nfs_tmp;
|
||||||
char buffer[SIZE];
|
char buffer[SIZE];
|
||||||
|
struct statfs statfs;
|
||||||
|
|
||||||
rc = system (cmd);
|
rc = system (cmd);
|
||||||
|
|
||||||
@ -137,7 +144,7 @@ void get_mounts (int * num_dirs, char ** dirs[], bool * nfs[])
|
|||||||
**dirs = NULL;
|
**dirs = NULL;
|
||||||
*nfs = NULL;
|
*nfs = NULL;
|
||||||
}
|
}
|
||||||
dirs_tmp = (char**) malloc (MAX_DIR * sizeof(char**));
|
dirs_tmp = (char**) calloc (MAX_DIR, sizeof(char**));
|
||||||
nfs_tmp = (bool*) malloc (MAX_DIR * sizeof(bool));
|
nfs_tmp = (bool*) malloc (MAX_DIR * sizeof(bool));
|
||||||
|
|
||||||
file = fopen("opal_path_nfs.out", "r");
|
file = fopen("opal_path_nfs.out", "r");
|
||||||
@ -147,7 +154,10 @@ void get_mounts (int * num_dirs, char ** dirs[], bool * nfs[])
|
|||||||
int mount_known;
|
int mount_known;
|
||||||
char fs[MAXNAMLEN];
|
char fs[MAXNAMLEN];
|
||||||
|
|
||||||
dirs_tmp[i] = malloc (MAXNAMLEN);
|
if (!dirs_tmp[i]) {
|
||||||
|
dirs_tmp[i] = malloc (MAXNAMLEN);
|
||||||
|
}
|
||||||
|
|
||||||
if (2 != (rc = sscanf (buffer, "%s %s\n", dirs_tmp[i], fs))) {
|
if (2 != (rc = sscanf (buffer, "%s %s\n", dirs_tmp[i], fs))) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@ -173,6 +183,11 @@ void get_mounts (int * num_dirs, char ** dirs[], bool * nfs[])
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If we can not stat the fs, skip it */
|
||||||
|
if (statfs (dirs_tmp[i], statfs)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Later mounts override earlier mounts
|
* Later mounts override earlier mounts
|
||||||
* (e.g. nfs-mount of /, vs. initial rootfs-mount of /).
|
* (e.g. nfs-mount of /, vs. initial rootfs-mount of /).
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user