diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-01-08 16:56:37 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-01-09 15:48:33 +0100 |
commit | c21087014e061f709f15af9eb835970754253e89 (patch) | |
tree | 2edc052c8b4f879afae7f82d93433414e03997a2 /src/shared/machine-image.c | |
parent | 8c8932a74151f2138c29d69413424cc6e3ba06a8 (diff) | |
download | systemd-c21087014e061f709f15af9eb835970754253e89.tar.gz |
machine-image: use structured initialization
Diffstat (limited to 'src/shared/machine-image.c')
-rw-r--r-- | src/shared/machine-image.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c index 0b148c067a..366abd8971 100644 --- a/src/shared/machine-image.c +++ b/src/shared/machine-image.c @@ -129,17 +129,21 @@ static int image_new( assert(filename); assert(ret); - i = new0(Image, 1); + i = new(Image, 1); if (!i) return -ENOMEM; - i->n_ref = 1; - i->type = t; - i->read_only = read_only; - i->crtime = crtime; - i->mtime = mtime; - i->usage = i->usage_exclusive = (uint64_t) -1; - i->limit = i->limit_exclusive = (uint64_t) -1; + *i = (Image) { + .n_ref = 1, + .type = t, + .read_only = read_only, + .crtime = crtime, + .mtime = mtime, + .usage = UINT64_MAX, + .usage_exclusive = UINT64_MAX, + .limit = UINT64_MAX, + .limit_exclusive = UINT64_MAX, + }; i->name = strdup(pretty); if (!i->name) |