summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2023-11-08 14:41:28 +0100
committerDavid Tardon <dtardon@redhat.com>2023-11-08 14:41:28 +0100
commite1593039dbb64e47e3ec81d2c913e7730d94a727 (patch)
tree386b201dee820b2a7ff71e140407218d565a4b18
parenttree-wide: fix typo (diff)
downloadsystemd-e1593039dbb64e47e3ec81d2c913e7730d94a727.tar.xz
systemd-e1593039dbb64e47e3ec81d2c913e7730d94a727.zip
udev-manager: actually remove the property
AFAICT there's no reason to keep removed entries in the Hashmap (although it doesn't break anything either). The only use of this hashmap is in udev_rule_apply_token_to_event(), which just retrieves the value using hashmap_get(), hence there's no difference there between an existing entry with a NULL value and a missing entry.
-rw-r--r--src/udev/udev-manager.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/udev/udev-manager.c b/src/udev/udev-manager.c
index 9d86845b5f..f2df61c4e8 100644
--- a/src/udev/udev-manager.c
+++ b/src/udev/udev-manager.c
@@ -918,15 +918,9 @@ static int on_ctrl_msg(UdevCtrl *uctrl, UdevCtrlMessageType type, const UdevCtrl
}
eq++;
- if (isempty(eq)) {
+ if (isempty(eq))
log_debug("Received udev control message (ENV), unsetting '%s'", key);
-
- r = hashmap_put(manager->properties, key, NULL);
- if (r < 0) {
- log_oom();
- return 1;
- }
- } else {
+ else {
val = strdup(eq);
if (!val) {
log_oom();