kernel/sem: Properly handle create_sem being called with a negative count.
It doesn't make much sense to do this, and the Be Book specifies that doing so will return an error. A user on the mailing list tested against BeOS and confirmed that it does reject this, so we should too.
This commit is contained in:
@@ -468,6 +468,8 @@ haiku_sem_init(kernel_args *args)
|
||||
sem_id
|
||||
create_sem_etc(int32 count, const char* name, team_id owner)
|
||||
{
|
||||
if (count < 0)
|
||||
return B_BAD_VALUE;
|
||||
if (!sSemsActive || sUsedSems == sMaxSems)
|
||||
return B_NO_MORE_SEMS;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user