1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

o if any pattern rejects a device, and there were no accepts then reject !

This commit is contained in:
Joe Thornber 2001-11-12 17:06:33 +00:00
parent f7cbb38dbb
commit ac61645c2d
4 changed files with 8 additions and 7 deletions

View File

@ -237,7 +237,7 @@ static int _insert(const char *path, int rec)
} else { /* add a device */
if (!S_ISBLK(info.st_mode)) {
log_debug("%s: Not a block device", path);
//log_debug("%s: Not a block device", path);
return 0;
}

View File

@ -150,7 +150,7 @@ static int _build_matcher(struct rfilter *rf, struct config_value *val)
static int _accept_p(struct dev_filter *f, struct device *dev)
{
struct list *ah;
int m, first = 1;
int m, first = 1, rejected = 0;
struct rfilter *rf = (struct rfilter *) f->private;
struct str_list *sl;
@ -168,8 +168,9 @@ static int _accept_p(struct dev_filter *f, struct device *dev)
return 1;
}
} else
return 1;
rejected = 1;
}
first = 0;
}
@ -178,7 +179,7 @@ static int _accept_p(struct dev_filter *f, struct device *dev)
* pass everything that doesn't match
* anything.
*/
return 1;
return !rejected;
}
static void _destroy(struct dev_filter *f)

View File

@ -99,7 +99,7 @@ int main(int argc, char **argv)
}
while ((dev = dev_iter_get(iter)))
printf("%s\n", dev->name);
printf("%s\n", dev_name(dev));
dev_iter_destroy(iter);
pfilter->destroy(pfilter);

View File

@ -70,7 +70,7 @@ int main(int argc, char **argv)
}
while ((dev = dev_iter_get(iter)))
printf("%s\n", dev->name);
printf("%s\n", dev_name(dev));
dev_iter_destroy(iter);
filter->destroy(filter);