systemd/1016-udev-builtin-do-not-fail-builtin-initialization-if-o.patch

65 lines
2.2 KiB
Diff
Raw Normal View History

Index: systemd-195/src/udev/udev-builtin.c
===================================================================
--- systemd-195.orig/src/udev/udev-builtin.c
+++ systemd-195/src/udev/udev-builtin.c
@@ -42,24 +42,18 @@ static const struct udev_builtin *builti
#endif
};
-int udev_builtin_init(struct udev *udev)
+void udev_builtin_init(struct udev *udev)
{
unsigned int i;
- int err = 0;
if (initialized)
- return 0;
+ return;
- for (i = 0; i < ELEMENTSOF(builtins); i++) {
- if (builtins[i]->init) {
- err = builtins[i]->init(udev);
- if (err < 0)
- break;
- }
- }
+ for (i = 0; i < ELEMENTSOF(builtins); i++)
+ if (builtins[i]->init)
+ builtins[i]->init(udev);
initialized = true;
- return err;
}
void udev_builtin_exit(struct udev *udev)
@@ -79,13 +73,11 @@ void udev_builtin_exit(struct udev *udev
bool udev_builtin_validate(struct udev *udev)
{
unsigned int i;
- bool change = false;
for (i = 0; i < ELEMENTSOF(builtins); i++)
- if (builtins[i]->validate)
- if (builtins[i]->validate(udev))
- change = true;
- return change;
+ if (builtins[i]->validate && builtins[i]->validate(udev))
+ return true;
+ return false;
}
void udev_builtin_list(struct udev *udev)
Index: systemd-195/src/udev/udev.h
===================================================================
--- systemd-195.orig/src/udev/udev.h
+++ systemd-195/src/udev/udev.h
@@ -167,7 +167,7 @@ extern const struct udev_builtin udev_bu
extern const struct udev_builtin udev_builtin_usb_db;
extern const struct udev_builtin udev_builtin_usb_id;
extern const struct udev_builtin udev_builtin_uaccess;
-int udev_builtin_init(struct udev *udev);
+void udev_builtin_init(struct udev *udev);
void udev_builtin_exit(struct udev *udev);
enum udev_builtin_cmd udev_builtin_lookup(const char *command);
const char *udev_builtin_name(enum udev_builtin_cmd cmd);