]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-manager: actually remove the property
authorDavid Tardon <dtardon@redhat.com>
Wed, 8 Nov 2023 13:41:28 +0000 (14:41 +0100)
committerDavid Tardon <dtardon@redhat.com>
Wed, 8 Nov 2023 13:41:28 +0000 (14:41 +0100)
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.

src/udev/udev-manager.c

index 9d86845b5f97cd50ef62af46fe2c862e21140f78..f2df61c4e8b75e56436ddfbb9685f6ac69e35838 100644 (file)
@@ -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();