Skip to content

Commit

Permalink
spawn/Direct: send return_cgroup message only in parent
Browse files Browse the repository at this point in the history
This fixes another regression by commit
e6e4805
  • Loading branch information
MaxKellermann committed Nov 21, 2024
1 parent 1a68d7c commit 268c2e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/spawn/Direct.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ SpawnChildProcess(PreparedChildProcess &&params,
if (pid < 0)
throw MakeErrno("clone() failed");

if (cgroup_fd.IsDefined() && params.return_cgroup.IsDefined())
if (pid > 0 && cgroup_fd.IsDefined() && params.return_cgroup.IsDefined())
EasySendMessage(params.return_cgroup, cgroup_fd);

break;
Expand Down

0 comments on commit 268c2e9

Please sign in to comment.