summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_pipe.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-03-04 15:09:01 +0000
committerkib <kib@FreeBSD.org>2012-03-04 15:09:01 +0000
commit6f473d57488b07070854b78d2369f6d7a33ecf22 (patch)
tree661488005ecb518e96802f234994a108e7e23809 /sys/kern/sys_pipe.c
parent273d08b6bcf1bb806b88df944a1496288cbacef6 (diff)
downloadFreeBSD-src-6f473d57488b07070854b78d2369f6d7a33ecf22.zip
FreeBSD-src-6f473d57488b07070854b78d2369f6d7a33ecf22.tar.gz
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
Diffstat (limited to 'sys/kern/sys_pipe.c')
-rw-r--r--sys/kern/sys_pipe.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index fd71569..89b9589 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -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;
OpenPOWER on IntegriCloud