summaryrefslogtreecommitdiff
path: root/udev/udev-builtin.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-12-27 03:49:43 +0100
committerKay Sievers <kay.sievers@vrfy.org>2011-12-27 03:49:43 +0100
commit4f1795cca7060030461c8f3429e5a62f143f74a9 (patch)
tree53ca617100f3ef014c790e40f3f6f81a2d7cd409 /udev/udev-builtin.c
parentd1aacc0fa997a9757adc923792a6c17753d05084 (diff)
move rules dirs to udev context; replace inotify with time-controlled stat()
Diffstat (limited to 'udev/udev-builtin.c')
-rw-r--r--udev/udev-builtin.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/udev/udev-builtin.c b/udev/udev-builtin.c
index cf62d57e23..9804c50fae 100644
--- a/udev/udev-builtin.c
+++ b/udev/udev-builtin.c
@@ -37,30 +37,45 @@ static const struct udev_builtin *builtins[] = {
int udev_builtin_init(struct udev *udev)
{
unsigned int i;
-
- for (i = 0; i < ARRAY_SIZE(builtins); i++)
- if (builtins[i]->init)
- builtins[i]->init(udev);
- return 0;
+ int err;
+
+ for (i = 0; i < ARRAY_SIZE(builtins); i++) {
+ if (builtins[i]->init) {
+ err = builtins[i]->init(udev);
+ if (err < 0)
+ break;
+ }
+ }
+ return err;
}
-int udev_builtin_exit(struct udev *udev)
+void udev_builtin_exit(struct udev *udev)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(builtins); i++)
if (builtins[i]->exit)
builtins[i]->exit(udev);
- return 0;
}
-int udev_builtin_list(struct udev *udev)
+bool udev_builtin_validate(struct udev *udev)
+{
+ unsigned int i;
+ bool change = false;
+
+ for (i = 0; i < ARRAY_SIZE(builtins); i++)
+ if (builtins[i]->validate)
+ if (builtins[i]->validate(udev))
+ change = true;
+ return change;
+}
+
+void udev_builtin_list(struct udev *udev)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(builtins); i++)
fprintf(stderr, " %-12s %s\n", builtins[i]->name, builtins[i]->help);
- return 0;
}
const char *udev_builtin_name(enum udev_builtin_cmd cmd)