make sem_leave return a usable errno instead of -1.
make ksem_close return that usable errno instead of -1 (ERESTART). PR: 46957
This commit is contained in:
parent
f3c6522625
commit
b3890a1c42
@ -494,7 +494,7 @@ sem_leave(p, ks)
|
||||
DP(("sem_leave: returning\n"));
|
||||
return (0);
|
||||
}
|
||||
return (-1);
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -590,9 +590,9 @@ kern_sem_close(td, id)
|
||||
ks = ID_TO_SEM(id);
|
||||
/* this is not a valid operation for unnamed sems */
|
||||
if (ks != NULL && ks->ks_name != NULL)
|
||||
error = sem_leave(td->td_proc, ks) == 0 ? 0 : EINVAL;
|
||||
error = sem_leave(td->td_proc, ks);
|
||||
mtx_unlock(&sem_lock);
|
||||
return (-1);
|
||||
return (error);
|
||||
}
|
||||
|
||||
#ifndef _SYS_SYSPROTO_H_
|
||||
|
Loading…
x
Reference in New Issue
Block a user