Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Mar 2012 15:09:02 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r232495 - head/sys/kern
Message-ID:  <201203041509.q24F92WU039878@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203041509.q24F92WU039878>