Skip to contentSkip to conversation

Fix device node deletion

PATCH New Michael Thayer 1 participant 1 message Apr 29, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix device node deletion

udev-152 and -153 do not remove device nodes again when a USB device is unplugged, instead printing the log message 'static device entry found -- not deleting'. I believe that the patch below against current udev git will fix this issue.

---

udev/udev-node.c +1 -1
@@ -428,7 +428,7 @@
 	}
 
 	util_strscpyl(filename, sizeof(filename), LIBEXECDIR "/devices", &devnode[strlen(udev_get_dev_path(udev))], NULL);
-	if (stat(filename, &stats) = 0 || stats.st_rdev = udev_device_get_devnum(dev)) {
+	if (stat(filename, &stats) = 0 && stats.st_rdev = udev_device_get_devnum(dev)) {
 		info(udev, "static device entry found '%s', skip removal\n", devnode);
 		goto out;
 	}
Signature · 8 lines
Sun Microsystems GmbH        Michael Thayer
Werkstrasse 24               VirtualBox engineer
71384 Weinstadt, Germany     mailto:[email protected]

Sitz der Gesellschaft:
Sun Microsystems GmbH, Sonnenallee 1, 85551 Kirchheim-Heimstetten
Amtsgericht Muenchen: HRB 161028
Geschaeftsfuehrer: Jürgen Kunz