From: Lennart Poettering Date: Fri, 8 Jan 2021 15:56:37 +0000 (+0100) Subject: machine-image: use structured initialization X-Git-Tag: v248-rc1~390^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c21087014e061f709f15af9eb835970754253e89;p=thirdparty%2Fsystemd.git machine-image: use structured initialization --- diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c index 0b148c067af..366abd89719 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)