svn commit: r320415 - head/sys/kern

Hans Petter Selasky hps at selasky.org
Wed Jun 28 06:44:49 UTC 2017


On 06/27/17 19:23, Conrad Meyer wrote:
> Author: cem
> Date: Tue Jun 27 17:23:20 2017
> New Revision: 320415
> URL: https://svnweb.freebsd.org/changeset/base/320415
> 
> Log:
>    Fix one more place uio_resid is truncated to int


Hi,

Should you use:

sys/sys/param.h:#define	MIN(a,b) (((a)<(b))?(a):(b))

Instead?

--HPS

>    
>    A follow-up to r231949 and r194990.
>    
>    Reported by:	pho@
>    Reviewed by:	kib@, markj@
>    Sponsored by:	Dell EMC Isilon
>    Differential Revision:	https://reviews.freebsd.org/D11373
> 
> Modified:
>    head/sys/kern/uipc_mbuf.c
> 
> Modified: head/sys/kern/uipc_mbuf.c
> ==============================================================================
> --- head/sys/kern/uipc_mbuf.c	Tue Jun 27 17:22:03 2017	(r320414)
> +++ head/sys/kern/uipc_mbuf.c	Tue Jun 27 17:23:20 2017	(r320415)
> @@ -1517,7 +1517,7 @@ m_uiotombuf(struct uio *uio, int how, int len, int ali
>   	 * the total data supplied by the uio.
>   	 */
>   	if (len > 0)
> -		total = min(uio->uio_resid, len);
> +		total = (uio->uio_resid < len) ? uio->uio_resid : len;
>   	else
>   		total = uio->uio_resid;
>   
> 
> 



More information about the svn-src-head mailing list