kernel: Avoid double lock in wait_for_child with child == team.
When wait_for_child was called with a child argument equal to the current team, the team was locked again to check if it was a child of itself. This is now handled the same way as on other systems, where this case results in ECHILD (and not EINVAL).
This commit is contained in:
@@ -2459,7 +2459,7 @@ wait_for_child(pid_t child, uint32 flags, siginfo_t& _info,
|
||||
childrenExist = team->children != NULL;
|
||||
} else if (child < -1) {
|
||||
childrenExist = has_children_in_group(team, -child);
|
||||
} else {
|
||||
} else if (child != team->id) {
|
||||
if (Team* childTeam = Team::Get(child)) {
|
||||
BReference<Team> childTeamReference(childTeam, true);
|
||||
TeamLocker childTeamLocker(childTeam);
|
||||
|
||||
Reference in New Issue
Block a user