handle negative arguments to sleep() a little better
This commit is contained in:
parent
f5b93ef12f
commit
463ae0abc3
1 changed files with 2 additions and 0 deletions
|
@ -55,6 +55,8 @@ sys_sleep(void)
|
|||
uint ticks0;
|
||||
|
||||
argint(0, &n);
|
||||
if(n < 0)
|
||||
n = 0;
|
||||
acquire(&tickslock);
|
||||
ticks0 = ticks;
|
||||
while(ticks - ticks0 < n){
|
||||
|
|
Loading…
Add table
Reference in a new issue