Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Sep 2018 13:20:41 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r338855 - head/sys/kern
Message-ID:  <201809211320.w8LDKfmP050911@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Fri Sep 21 13:20:41 2018
New Revision: 338855
URL: https://svnweb.freebsd.org/changeset/base/338855

Log:
  select: stop doing zero-sized memsets
  
  Approved by:	re (kib)

Modified:
  head/sys/kern/sys_generic.c

Modified: head/sys/kern/sys_generic.c
==============================================================================
--- head/sys/kern/sys_generic.c	Fri Sep 21 13:02:25 2018	(r338854)
+++ head/sys/kern/sys_generic.c	Fri Sep 21 13:20:41 2018	(r338855)
@@ -1031,8 +1031,9 @@ kern_select(struct thread *td, int nd, fd_set *fd_in, 
 			error = copyin(name, ibits[x], ncpubytes);	\
 			if (error != 0)					\
 				goto done;				\
-			bzero((char *)ibits[x] + ncpubytes,		\
-			    ncpbytes - ncpubytes);			\
+			if (ncpbytes != ncpubytes)			\
+				bzero((char *)ibits[x] + ncpubytes,	\
+				    ncpbytes - ncpubytes);		\
 		}							\
 	} while (0)
 	getbits(fd_in, 0);



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