summaryrefslogtreecommitdiff
path: root/src/snapshot.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-01-15 12:25:20 +0100
committerMichal Schmidt <mschmidt@redhat.com>2012-01-16 13:34:42 +0100
commit1124fe6f01b1d59d016c238026f20380f38d98dc (patch)
tree15cf55a860c5b1faabb7c09eeb8fea0e138a08c1 /src/snapshot.c
parentac155bb885f9ea8aac3979a6b2686f0c8a9cc6e3 (diff)
unit: use the UNIT() macro consistently
The UNIT() macro upcasts from specific unit types to the base Unit. Use it everywhere, rather than accessing the 'meta' member directly.
Diffstat (limited to 'src/snapshot.c')
-rw-r--r--src/snapshot.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/snapshot.c b/src/snapshot.c
index bc1388c36a..82ec5104db 100644
--- a/src/snapshot.c
+++ b/src/snapshot.c
@@ -36,10 +36,10 @@ static void snapshot_init(Unit *u) {
Snapshot *s = SNAPSHOT(u);
assert(s);
- assert(s->meta.load_state == UNIT_STUB);
+ assert(UNIT(s)->load_state == UNIT_STUB);
- s->meta.ignore_on_isolate = true;
- s->meta.ignore_on_snapshot = true;
+ UNIT(s)->ignore_on_isolate = true;
+ UNIT(s)->ignore_on_snapshot = true;
}
static void snapshot_set_state(Snapshot *s, SnapshotState state) {
@@ -51,7 +51,7 @@ static void snapshot_set_state(Snapshot *s, SnapshotState state) {
if (state != old_state)
log_debug("%s changed %s -> %s",
- s->meta.id,
+ UNIT(s)->id,
snapshot_state_to_string(old_state),
snapshot_state_to_string(state));
@@ -66,7 +66,7 @@ static int snapshot_load(Unit *u) {
/* Make sure that only snapshots created via snapshot_create()
* can be loaded */
- if (!s->by_snapshot_create && s->meta.manager->n_reloading <= 0)
+ if (!s->by_snapshot_create && UNIT(s)->manager->n_reloading <= 0)
return -ENOENT;
u->load_state = UNIT_LOADED;