chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
main: don't open console in --test mode
[elogind.git]
/
snapshot.c
diff --git
a/snapshot.c
b/snapshot.c
index d0aaa51fee48268be8c353f04c1ceb4ae2975a6b..513bf66475679106698f1983fba5a6d058bca519 100644
(file)
--- a/
snapshot.c
+++ b/
snapshot.c
@@
-39,7
+39,7
@@
static void snapshot_set_state(Snapshot *s, SnapshotState state) {
s->state = state;
if (state != old_state)
s->state = state;
if (state != old_state)
- log_debug("%s changed %s
→
%s",
+ log_debug("%s changed %s
->
%s",
UNIT(s)->meta.id,
snapshot_state_to_string(old_state),
snapshot_state_to_string(state));
UNIT(s)->meta.id,
snapshot_state_to_string(old_state),
snapshot_state_to_string(state));
@@
-139,10
+139,10
@@
static int snapshot_deserialize_item(Unit *u, const char *key, const char *value
} else if (streq(key, "requires")) {
} else if (streq(key, "requires")) {
- if ((r = unit_add_dependency_by_name(u, UNIT_AFTER, value, NULL)) < 0)
+ if ((r = unit_add_dependency_by_name(u, UNIT_AFTER, value, NULL
, true
)) < 0)
return r;
return r;
- if ((r = unit_add_dependency_by_name(u, UNIT_REQUIRES, value, NULL)) < 0)
+ if ((r = unit_add_dependency_by_name(u, UNIT_REQUIRES, value, NULL
, true
)) < 0)
return r;
} else
log_debug("Unknown serialization key '%s'", key);
return r;
} else
log_debug("Unknown serialization key '%s'", key);
@@
-211,13
+211,17
@@
int snapshot_create(Manager *m, const char *name, bool cleanup, Snapshot **_s) {
if (k != other->meta.id)
continue;
if (k != other->meta.id)
continue;
+ if (UNIT_VTABLE(other)->check_snapshot)
+ if (!UNIT_VTABLE(other)->check_snapshot(other))
+ continue;
+
if (!UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(other)))
continue;
if (!UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(other)))
continue;
- if ((r = unit_add_dependency(u, UNIT_REQUIRES, other)) < 0)
+ if ((r = unit_add_dependency(u, UNIT_REQUIRES, other
, true
)) < 0)
goto fail;
goto fail;
- if ((r = unit_add_dependency(u, UNIT_AFTER, other)) < 0)
+ if ((r = unit_add_dependency(u, UNIT_AFTER, other
, true
)) < 0)
goto fail;
}
goto fail;
}
@@
-252,6
+256,7
@@
const UnitVTable snapshot_vtable = {
.no_alias = true,
.no_instances = true,
.no_snapshots = true,
.no_alias = true,
.no_instances = true,
.no_snapshots = true,
+ .no_gc = true,
.load = unit_load_nop,
.coldplug = snapshot_coldplug,
.load = unit_load_nop,
.coldplug = snapshot_coldplug,