summaryrefslogtreecommitdiffstats
path: root/src/libudev/libudev.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-08-28 06:14:42 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-09-11 05:45:21 +0200
commit5ccb44a53f998c56699af34ff6f129d366f34fc7 (patch)
tree5e4f21493f26de313a76858584255eded838921e /src/libudev/libudev.c
parentlibudev: drop unused element in udev struct (diff)
downloadsystemd-5ccb44a53f998c56699af34ff6f129d366f34fc7.tar.xz
systemd-5ccb44a53f998c56699af34ff6f129d366f34fc7.zip
libudev: use structured initializer
Diffstat (limited to '')
-rw-r--r--src/libudev/libudev.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libudev/libudev.c b/src/libudev/libudev.c
index f67b8fccc4..0c3524a209 100644
--- a/src/libudev/libudev.c
+++ b/src/libudev/libudev.c
@@ -71,12 +71,15 @@ _public_ void udev_set_userdata(struct udev *udev, void *userdata) {
_public_ struct udev *udev_new(void) {
struct udev *udev;
- udev = new0(struct udev, 1);
+ udev = new(struct udev, 1);
if (!udev) {
errno = ENOMEM;
return NULL;
}
- udev->n_ref = 1;
+
+ *udev = (struct udev) {
+ .n_ref = 1,
+ };
return udev;
}