Skip to content

Commit 3c58556

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)
1 parent 92aeef5 commit 3c58556

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

52965296
/* Tell machined that we are gone. */
5297-
if (bus)
5297+
if (arg_register && bus)
52985298
(void) unregister_machine(bus, arg_machine);
52995299

53005300
if (r < 0)

0 commit comments

Comments
 (0)