streamline copyin/copyout code in usertests

fix bugs in read/write return values when there's an error
This commit is contained in:
Robert Morris 2020-08-07 15:06:43 -04:00 committed by Frans Kaashoek
parent a93321cb25
commit e3b7058907
4 changed files with 93 additions and 84 deletions

View file

@ -76,7 +76,7 @@ consolewrite(int user_src, uint64 src, int n)
}
release(&cons.lock);
return n;
return i;
}
//

View file

@ -472,7 +472,7 @@ readi(struct inode *ip, int user_dst, uint64 dst, uint off, uint n)
}
brelse(bp);
}
return n;
return tot;
}
// Write data to inode.

View file

@ -96,7 +96,7 @@ pipewrite(struct pipe *pi, uint64 addr, int n)
}
wakeup(&pi->nread);
release(&pi->lock);
return n;
return i;
}
int