udev: do not kill workers when requested to set the same log level currently assigned

Also refuse invalid log level.
This commit is contained in:
Yu Watanabe
2022-08-28 08:06:25 +00:00
committed by Frantisek Sumsal
parent f86d991dd4
commit 53c8590f8d
+10
View File
@@ -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);