- if (argc == 2 && argv[1][0] != '-') {
- dbg("called by hotplug");
- retval = udev_hotplug(argc, argv);
+ /* run dev.d/ scripts if we created/deleted a node or changed a netif name */
+ if (udev_dev_d && udev.devname[0] != '\0')
+ udev_multiplex_directory(&udev, DEVD_DIR, DEVD_SUFFIX);
+
+ } else if (udev.type == DEV_DEVICE) {
+ if (strcmp(action, "add") == 0) {
+ /* wait for sysfs */
+ dbg("devices add");
+
+ snprintf(path, sizeof(path), "%s%s", sysfs_path, devpath);
+ path[sizeof(path)-1] = '\0';
+ devices_dev = wait_devices_device_open(path);
+ if (!devices_dev) {
+ dbg("devices device unavailable (probably remove has beaten us)");
+ goto hotplug;
+ }
+ dbg("devices device opened '%s'", path);
+
+ wait_for_devices_device(devices_dev, &error);
+
+ sysfs_close_device(devices_dev);
+ } else if (strcmp(action, "remove") == 0) {
+ dbg("devices remove");
+ }