pipe_read(): change the type of size to int, and remove signed clamp.

pipe_write(): change the type of desiredsize back to int, its value fits.

Requested by: bde
MFC after:    3 weeks
This commit is contained in:
Konstantin Belousov 2012-03-04 15:09:01 +00:00
parent 8bb9a904d5
commit e7f19c3d81
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=232495

View File

@ -647,7 +647,7 @@ pipe_read(fp, uio, active_cred, flags, td)
struct pipe *rpipe;
int error;
int nread = 0;
u_int size;
int size;
rpipe = fp->f_data;
PIPE_LOCK(rpipe);
@ -681,7 +681,7 @@ pipe_read(fp, uio, active_cred, flags, td)
if (size > rpipe->pipe_buffer.cnt)
size = rpipe->pipe_buffer.cnt;
if (size > uio->uio_resid)
size = (u_int) uio->uio_resid;
size = uio->uio_resid;
PIPE_UNLOCK(rpipe);
error = uiomove(
@ -1023,8 +1023,9 @@ pipe_write(fp, uio, active_cred, flags, td)
struct thread *td;
int flags;
{
int error;
size_t desiredsize, orig_resid;
int error = 0;
int desiredsize;
ssize_t orig_resid;
struct pipe *wpipe, *rpipe;
rpipe = fp->f_data;