]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
job: use structured initialization
authorLennart Poettering <lennart@poettering.net>
Wed, 17 Oct 2018 17:07:15 +0000 (19:07 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 17 Oct 2018 19:18:02 +0000 (21:18 +0200)
src/core/job.c

index 6b17cc1d6f6da22014d720e601cfd9bf5b4f3539..d560453bf89db5187cafa53ba5c550ac82cd38e6 100644 (file)
@@ -31,14 +31,15 @@ Job* job_new_raw(Unit *unit) {
 
         assert(unit);
 
-        j = new0(Job, 1);
+        j = new(Job, 1);
         if (!j)
                 return NULL;
 
-        j->manager = unit->manager;
-        j->unit = unit;
-        j->type = _JOB_TYPE_INVALID;
-        j->reloaded = false;
+        *j = (Job) {
+                .manager = unit->manager,
+                .unit = unit,
+                .type = _JOB_TYPE_INVALID,
+        };
 
         return j;
 }