diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2012-01-15 12:04:08 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2012-01-16 13:34:42 +0100 |
commit | ac155bb885f9ea8aac3979a6b2686f0c8a9cc6e3 (patch) | |
tree | 6d78545bae4ffd262ddf4fd71d17ded342c530ca /src/snapshot.c | |
parent | 7d17cfbc46306a106dbda0f3e92fbc0792d1e9e9 (diff) |
unit: remove union Unit
Now that objects of all unit types are allocated the exact amount of
memory they need, the Unit union has lost its purpose. Remove it.
"Unit" is a more natural name for the base unit class than "Meta", so
rename Meta to Unit.
Access to members of the base class gets simplified.
Diffstat (limited to 'src/snapshot.c')
-rw-r--r-- | src/snapshot.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/snapshot.c b/src/snapshot.c index 161629d983..bc1388c36a 100644 --- a/src/snapshot.c +++ b/src/snapshot.c @@ -62,14 +62,14 @@ static int snapshot_load(Unit *u) { Snapshot *s = SNAPSHOT(u); assert(u); - assert(u->meta.load_state == UNIT_STUB); + assert(u->load_state == UNIT_STUB); /* Make sure that only snapshots created via snapshot_create() * can be loaded */ if (!s->by_snapshot_create && s->meta.manager->n_reloading <= 0) return -ENOENT; - u->meta.load_state = UNIT_LOADED; + u->load_state = UNIT_LOADED; return 0; } @@ -133,8 +133,8 @@ static int snapshot_serialize(Unit *u, FILE *f, FDSet *fds) { unit_serialize_item(u, f, "state", snapshot_state_to_string(s->state)); unit_serialize_item(u, f, "cleanup", yes_no(s->cleanup)); - SET_FOREACH(other, u->meta.dependencies[UNIT_WANTS], i) - unit_serialize_item(u, f, "wants", other->meta.id); + SET_FOREACH(other, u->dependencies[UNIT_WANTS], i) + unit_serialize_item(u, f, "wants", other->id); return 0; } @@ -234,14 +234,14 @@ int snapshot_create(Manager *m, const char *name, bool cleanup, DBusError *e, Sn SNAPSHOT(u)->by_snapshot_create = true; manager_dispatch_load_queue(m); - assert(u->meta.load_state == UNIT_LOADED); + assert(u->load_state == UNIT_LOADED); HASHMAP_FOREACH_KEY(other, k, m->units, i) { - if (other->meta.ignore_on_snapshot) + if (other->ignore_on_snapshot) continue; - if (k != other->meta.id) + if (k != other->id) continue; if (UNIT_VTABLE(other)->check_snapshot) |