summaryrefslogtreecommitdiff
path: root/src/libudev
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@users.noreply.github.com>2017-02-22 04:46:13 +0530
committerLennart Poettering <lennart@poettering.net>2017-02-22 00:16:13 +0100
commitc22569eeeafa94cf510267071f5b75c4ab714e09 (patch)
tree52ead6c2152f6b137c93f8163eb00f05b7240c17 /src/libudev
parent0f5a443e8cbb551613472aa93299f4f1d410ed87 (diff)
downloadsystemd-c22569eeeafa94cf510267071f5b75c4ab714e09.tar.gz
udev: Introduce UDEV_PROPAGATE_LOG macro (#5302)
As per commit 25e773e "udev: switch to systemd logging functions" Now log_set_max_level() in udev_new() overwites system wide log level. Propagate the udev.conf setting to log_set_max_level() only if udev_new() is called from within udevd or one of its helpers. Introduce a UDEV_PROPAGATE_LOG macro that we set with -D on the gcc command line for all udev binaries we build, but not for any others. The log_set_max_level() call is guarded by an ifdef check for that macro, so that it only effects the various udev binaries. closes: #4525
Diffstat (limited to 'src/libudev')
-rw-r--r--src/libudev/libudev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libudev/libudev.c b/src/libudev/libudev.c
index d8e13288b0..7c6aeef8dc 100644
--- a/src/libudev/libudev.c
+++ b/src/libudev/libudev.c
@@ -103,6 +103,8 @@ _public_ struct udev *udev_new(void) {
}
udev->refcount = 1;
+#ifdef UDEV_PROPAGATE_LOG
+
f = fopen("/etc/udev/udev.conf", "re");
if (f != NULL) {
char line[UTIL_LINE_SIZE];
@@ -178,6 +180,7 @@ _public_ struct udev *udev_new(void) {
}
}
}
+#endif
return udev;
}