mirror of
https://github.com/systemd/systemd.git
synced 2025-01-07 21:18:41 +03:00
libudev-device: use structured initializer
This commit is contained in:
parent
60fdee32bd
commit
71074e3a10
@ -196,13 +196,17 @@ _public_ const char *udev_device_get_property_value(struct udev_device *udev_dev
|
||||
struct udev_device *udev_device_new(struct udev *udev) {
|
||||
struct udev_device *udev_device;
|
||||
|
||||
udev_device = new0(struct udev_device, 1);
|
||||
udev_device = new(struct udev_device, 1);
|
||||
if (!udev_device) {
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
udev_device->n_ref = 1;
|
||||
udev_device->udev = udev;
|
||||
|
||||
*udev_device = (struct udev_device) {
|
||||
.n_ref = 1,
|
||||
.udev = udev,
|
||||
};
|
||||
|
||||
udev_list_init(udev, &udev_device->properties, true);
|
||||
udev_list_init(udev, &udev_device->tags, true);
|
||||
udev_list_init(udev, &udev_device->sysattrs, true);
|
||||
|
Loading…
Reference in New Issue
Block a user