summaryrefslogtreecommitdiff
path: root/src/machine/machine.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/machine/machine.c')
-rw-r--r--src/machine/machine.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/machine/machine.c b/src/machine/machine.c
index 0b0d45bb26..c0fa1b24b6 100644
--- a/src/machine/machine.c
+++ b/src/machine/machine.c
@@ -360,10 +360,12 @@ static int machine_stop_scope(Machine *m) {
if (!m->unit)
return 0;
- r = manager_stop_unit(m->manager, m->unit, &error, &job);
- if (r < 0) {
- log_error("Failed to stop machine scope: %s", bus_error_message(&error, r));
- return r;
+ if (!m->registered) {
+ r = manager_stop_unit(m->manager, m->unit, &error, &job);
+ if (r < 0) {
+ log_error("Failed to stop machine scope: %s", bus_error_message(&error, r));
+ return r;
+ }
}
free(m->scope_job);