streamline copyin/copyout code in usertests
fix bugs in read/write return values when there's an error
This commit is contained in:
parent
a93321cb25
commit
e3b7058907
4 changed files with 93 additions and 84 deletions
|
@ -76,7 +76,7 @@ consolewrite(int user_src, uint64 src, int n)
|
|||
}
|
||||
release(&cons.lock);
|
||||
|
||||
return n;
|
||||
return i;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -96,7 +96,7 @@ pipewrite(struct pipe *pi, uint64 addr, int n)
|
|||
}
|
||||
wakeup(&pi->nread);
|
||||
release(&pi->lock);
|
||||
return n;
|
||||
return i;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue