Skip to content

Commit d764298

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) (cherry picked from commit 342c67d) (cherry picked from commit 3c58556)
1 parent 43f941c commit d764298

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

53035303
/* Tell machined that we are gone. */
5304-
if (bus)
5304+
if (arg_register && bus)
53055305
(void) unregister_machine(bus, arg_machine);
53065306

53075307
if (r < 0)

0 commit comments

Comments
 (0)