svn commit: r232495 - head/sys/kern

Konstantin Belousov kib at FreeBSD.org
Sun Mar 4 15:09:02 UTC 2012


Author: kib
Date: Sun Mar  4 15:09:01 2012
New Revision: 232495
URL: http://svn.freebsd.org/changeset/base/232495

Log:
  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

Modified:
  head/sys/kern/sys_pipe.c

Modified: head/sys/kern/sys_pipe.c
==============================================================================
--- head/sys/kern/sys_pipe.c	Sun Mar  4 14:55:37 2012	(r232494)
+++ head/sys/kern/sys_pipe.c	Sun Mar  4 15:09:01 2012	(r232495)
@@ -647,7 +647,7 @@ pipe_read(fp, uio, active_cred, flags, t
 	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, t
 			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, 
 	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;


More information about the svn-src-head mailing list