Skip to content

Commit 342c67d

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) (cherry picked from commit 85804e6)
1 parent b168d6f commit 342c67d

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
@@ -5300,7 +5300,7 @@ static int run_container(
53005300
r = wait_for_container(TAKE_PID(*pid), &container_status);
53015301

53025302
/* Tell machined that we are gone. */
5303-
if (bus)
5303+
if (arg_register && bus)
53045304
(void) unregister_machine(bus, arg_machine);
53055305

53065306
if (r < 0)

0 commit comments

Comments
 (0)