summaryrefslogtreecommitdiffstats
path: root/src/udev/udevd.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-08-28 04:14:51 +0200
committerFrantisek Sumsal <frantisek@sumsal.cz>2022-08-28 10:06:25 +0200
commit53c8590f8d811dc9dc985e849de7d9a1fd4413ff (patch)
treea9bb3bd728ef69ac02fe3103dd8032036d2907ba /src/udev/udevd.c
parentudev/net: drop unused timestamp (diff)
downloadsystemd-53c8590f8d811dc9dc985e849de7d9a1fd4413ff.tar.xz
systemd-53c8590f8d811dc9dc985e849de7d9a1fd4413ff.zip
udev: do not kill workers when requested to set the same log level currently assigned
Also refuse invalid log level.
Diffstat (limited to '')
-rw-r--r--src/udev/udevd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 028492721e..b179dfac37 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -1254,7 +1254,17 @@ static int on_ctrl_msg(UdevCtrl *uctrl, UdevCtrlMessageType type, const UdevCtrl
switch (type) {
case UDEV_CTRL_SET_LOG_LEVEL:
+ if ((value->intval & LOG_PRIMASK) != value->intval) {
+ log_debug("Received invalid udev control message (SET_LOG_LEVEL, %i), ignoring.", value->intval);
+ break;
+ }
+
log_debug("Received udev control message (SET_LOG_LEVEL), setting log_level=%i", value->intval);
+
+ r = log_get_max_level();
+ if (r == value->intval)
+ break;
+
log_set_max_level(value->intval);
manager->log_level = value->intval;
manager_kill_workers(manager, false);