Skip to content

Commit 85804e6

Browse files
poetteringbluca
authored andcommitted
nspawn: don't try to unregister a machine we never registered
When registering we condition this on "arg_register". Let's do the same when unregistering, otherwise we might end up trying to unregister a machine we never registered. (cherry picked from commit 0790f4e) (cherry picked from commit 6f346ef)
1 parent 03d691f commit 85804e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/nspawn/nspawn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5237,7 +5237,7 @@ static int run_container(
52375237
r = wait_for_container(TAKE_PID(*pid), &container_status);
52385238

52395239
/* Tell machined that we are gone. */
5240-
if (bus)
5240+
if (arg_register && bus)
52415241
(void) unregister_machine(bus, arg_machine);
52425242

52435243
if (r < 0)

0 commit comments

Comments
 (0)