]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udevd: fix a reversed conditional on global property set
authorLubomir Rintel <lkundrak@v3.sk>
Mon, 24 Jun 2019 17:23:13 +0000 (19:23 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 25 Jun 2019 01:20:48 +0000 (10:20 +0900)
  # udevadm control --property=HELLO=WORLD
  Received udev control message (ENV), unsetting 'HELLO'
  # udevadm control --property=HELLO=
  Received udev control message (ENV), setting 'HELLO='

Oh no, it's busted. Let's try removing this one little negation real quick
to see if it helps...

  # udevadm control --property=HELLO=WORLD
  Received udev control message (ENV), setting 'HELLO=WORLD'
  # udevadm control --property=HELLO=
  Received udev control message (ENV), unsetting 'HELLO'

Feels much better now.

src/udev/udevd.c

index 8e7402fd875b338aea2deba1c3c6264ed114826f..25a1095ff4c363ebe4cc77f8a24a795a8e140374 100644 (file)
@@ -1052,7 +1052,7 @@ static int on_ctrl_msg(struct udev_ctrl *uctrl, enum udev_ctrl_msg_type type, co
                 }
 
                 eq++;
-                if (!isempty(eq)) {
+                if (isempty(eq)) {
                         log_debug("Received udev control message (ENV), unsetting '%s'", key);
 
                         r = hashmap_put(manager->properties, key, NULL);