mirror of
https://github.com/systemd/systemd.git
synced 2025-01-25 10:04:04 +03:00
udev-builtin: use FOREACH_ELEMENT() macro
This commit is contained in:
parent
130698dc20
commit
975115321f
@ -36,9 +36,9 @@ void udev_builtin_init(void) {
|
|||||||
if (initialized)
|
if (initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (UdevBuiltinCommand i = 0; i < _UDEV_BUILTIN_MAX; i++)
|
FOREACH_ELEMENT(b, builtins)
|
||||||
if (builtins[i] && builtins[i]->init)
|
if (*b && (*b)->init)
|
||||||
builtins[i]->init();
|
(*b)->init();
|
||||||
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
@ -47,9 +47,9 @@ void udev_builtin_exit(void) {
|
|||||||
if (!initialized)
|
if (!initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (UdevBuiltinCommand i = 0; i < _UDEV_BUILTIN_MAX; i++)
|
FOREACH_ELEMENT(b, builtins)
|
||||||
if (builtins[i] && builtins[i]->exit)
|
if (*b && (*b)->exit)
|
||||||
builtins[i]->exit();
|
(*b)->exit();
|
||||||
|
|
||||||
initialized = false;
|
initialized = false;
|
||||||
}
|
}
|
||||||
@ -62,9 +62,9 @@ bool udev_builtin_should_reload(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void udev_builtin_list(void) {
|
void udev_builtin_list(void) {
|
||||||
for (UdevBuiltinCommand i = 0; i < _UDEV_BUILTIN_MAX; i++)
|
FOREACH_ELEMENT(b, builtins)
|
||||||
if (builtins[i])
|
if (*b)
|
||||||
fprintf(stderr, " %-14s %s\n", builtins[i]->name, builtins[i]->help);
|
fprintf(stderr, " %-14s %s\n", (*b)->name, (*b)->help);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* udev_builtin_name(UdevBuiltinCommand cmd) {
|
const char* udev_builtin_name(UdevBuiltinCommand cmd) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user