Otherwise, the sd_device object cannot read correct udev database file.
int device_set_devtype(sd_device *device, const char *devtype);
int device_set_devnum(sd_device *device, const char *major, const char *minor);
int device_set_subsystem(sd_device *device, const char *_subsystem);
+int device_set_drivers_subsystem(sd_device *device);
int device_set_driver(sd_device *device, const char *_driver);
int device_set_usec_initialized(sd_device *device, usec_t when);
}
static int device_verify(sd_device *device) {
+ int r;
+
assert(device);
if (!device->devpath || !device->subsystem || device->action < 0 || device->seqnum == 0)
return log_device_debug_errno(device, SYNTHETIC_ERRNO(EINVAL),
"sd-device: Device created from strv or nulstr lacks devpath, subsystem, action or seqnum.");
+ if (streq(device->subsystem, "drivers")) {
+ r = device_set_drivers_subsystem(device);
+ if (r < 0)
+ return r;
+ }
+
device->sealed = true;
return 0;
return free_and_replace(device->subsystem, subsystem);
}
-static int device_set_drivers_subsystem(sd_device *device) {
+int device_set_drivers_subsystem(sd_device *device) {
_cleanup_free_ char *subsystem = NULL;
const char *syspath, *drivers, *p;
int r;