diff options
author | David Tardon <dtardon@redhat.com> | 2024-01-05 16:11:24 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-01-11 21:12:42 +0100 |
commit | 09dd8e77fc7da645e716f34ba7fa38d4666460f6 (patch) | |
tree | 15af53f001797d15c599151b97042969f8b53632 /src/shared/udev-util.c | |
parent | udev-util: drop unused function (diff) | |
download | systemd-09dd8e77fc7da645e716f34ba7fa38d4666460f6.tar.xz systemd-09dd8e77fc7da645e716f34ba7fa38d4666460f6.zip |
udev: factor out config parser call into function
... which is then called from both places. This makes sure that the
configuration is parsed by udevd and other tools in exactly the same
way.
Diffstat (limited to 'src/shared/udev-util.c')
-rw-r--r-- | src/shared/udev-util.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/shared/udev-util.c b/src/shared/udev-util.c index 68e594e065..7a86289d16 100644 --- a/src/shared/udev-util.c +++ b/src/shared/udev-util.c @@ -5,7 +5,6 @@ #include <unistd.h> #include "alloc-util.h" -#include "conf-parser.h" #include "device-nodes.h" #include "device-private.h" #include "device-util.h" @@ -23,12 +22,10 @@ #include "udev-util.h" #include "utf8.h" -int udev_parse_config(void) { - int r, log_val = -1; - const ConfigTableItem config_table[] = { - { NULL, "udev_log", config_parse_log_level, 0, &log_val }, - {} - }; +int udev_parse_config_full(const ConfigTableItem config_table[]) { + int r; + + assert(config_table); r = config_parse_config_file_full( "udev.conf", @@ -40,6 +37,17 @@ int udev_parse_config(void) { /* userdata = */ NULL); if (r == -ENOENT) return 0; + return r; +} + +int udev_parse_config(void) { + int r, log_val = -1; + const ConfigTableItem config_table[] = { + { NULL, "udev_log", config_parse_log_level, 0, &log_val }, + {} + }; + + r = udev_parse_config_full(config_table); if (r < 0) return r; |