From 0d94088e4e9e00f5ca9afdb8e68c94558fe23268 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 24 Nov 2018 03:52:35 +0900 Subject: import: use structured initializers --- src/import/export-raw.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/import/export-raw.c') diff --git a/src/import/export-raw.c b/src/import/export-raw.c index f3a34d40c5..04ad129ca1 100644 --- a/src/import/export-raw.c +++ b/src/import/export-raw.c @@ -86,16 +86,19 @@ int raw_export_new( assert(ret); - e = new0(RawExport, 1); + e = new(RawExport, 1); if (!e) return -ENOMEM; - e->output_fd = e->input_fd = -1; - e->on_finished = on_finished; - e->userdata = userdata; + *e = (RawExport) { + .output_fd = -1, + .input_fd = -1, + .on_finished = on_finished, + .userdata = userdata, + .last_percent = (unsigned) -1, + }; RATELIMIT_INIT(e->progress_rate_limit, 100 * USEC_PER_MSEC, 1); - e->last_percent = (unsigned) -1; if (event) e->event = sd_event_ref(event); -- cgit v1.2.3