chiark / gitweb /
do not remove static nodes on module unload
[elogind.git] / udev / udev-node.c
index dc7d9c365a64efaa6b53eff9b75d8b0077104f07..6fbe250b85ff0e836ae30302302d25c267c7471d 100644 (file)
@@ -425,6 +425,11 @@ int udev_node_remove(struct udev_device *dev)
                goto out;
        }
 
+       if (stats.st_mode & 01000) {
+               info(udev, "device node '%s' has sticky bit set, skip removal\n", devnode);
+               goto out;
+       }
+
        dev_check = udev_device_new_from_syspath(udev, udev_device_get_syspath(dev));
        if (dev_check != NULL) {
                /* do not remove device node if the same sys-device is re-created in the meantime */