Skip to content

Commit

Permalink
spawn/Direct: don't close return_cgroup before using it
Browse files Browse the repository at this point in the history
This fixes a regression by commit e6e4805
  • Loading branch information
MaxKellermann committed Nov 21, 2024
1 parent 9dc0440 commit 1a68d7c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/spawn/Direct.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,6 @@ SpawnChildProcess(PreparedChildProcess &&params,
}
}

if (params.return_cgroup.IsDefined())
params.return_cgroup.Close();

pid = clone3(&ca, sizeof(ca));
if (pid < 0)
throw MakeErrno("clone() failed");
Expand All @@ -583,6 +580,9 @@ SpawnChildProcess(PreparedChildProcess &&params,
}
}

if (params.return_cgroup.IsDefined())
params.return_cgroup.Close();

if (pid == 0) {
userns_map_pipe_w.Close();
userns_create_pipe_r.Close();
Expand Down

0 comments on commit 1a68d7c

Please sign in to comment.