1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 This file is part of systemd.
5 Copyright 2017 Zbigniew Jędrzejewski-Szmek
12 #include "string-util.h"
13 #include "udev-util.h"
15 /// Additional includes needed by elogind
16 #include "alloc-util.h"
18 int udev_parse_config(void) {
19 _cleanup_free_ char *val = NULL;
24 r = parse_env_file("/etc/udev/udev.conf", NEWLINE, "udev_log", &val, NULL);
25 if (r == -ENOENT || !val)
33 ((val[0] == '"' && val[n-1] == '"') ||
34 (val[0] == '\'' && val[n-1] == '\''))) {
40 /* we set the udev log level here explicitly, this is supposed
41 * to regulate the code in libudev/ and udev/. */
42 r = log_set_max_level_from_string_realm(LOG_REALM_UDEV, log);
44 log_debug_errno(r, "/etc/udev/udev.conf: failed to set udev log level '%s', ignoring: %m", log);