Resolves issues like:
mdadm -Ss
mdadm: unable to open /dev/md/r1: No such file or directory
...where /dev/md/r1 points to a removed device.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
int add_dev(const char *name, const struct stat *stb, int flag, struct FTW *s)
{
struct stat st;
int add_dev(const char *name, const struct stat *stb, int flag, struct FTW *s)
{
struct stat st;
if (S_ISLNK(stb->st_mode)) {
if (S_ISLNK(stb->st_mode)) {
+ if (stat(name, &st) != 0)
+ return 0;