The point of "hotplug" call is to add or remove a single entry to/from
devices list. Using vlist_update() and vlist_flush() was clearing whole
list (and leaving the last entry in case of adding a device).
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
if (!device)
return UBUS_STATUS_UNKNOWN_ERROR;
- vlist_update(&devices);
if (data[MOUNT_REMOVE]) {
vlist_delete(&devices, &device->node);
} else {
strcpy(__target, target);
vlist_add(&devices, &device->node, device->name);
}
- vlist_flush(&devices);
return 0;
}