Date: Tue, 12 Nov 2002 15:49:05 -0800 (PST) From: Archie Cobbs <archie@dellroad.org> To: Mike Barcroft <mike@FreeBSD.org> Cc: Marc Recht <marc@informatik.uni-bremen.de>, Garrett Wollman <wollman@lcs.mit.edu>, current@FreeBSD.org Subject: Re: addition to cdefs Message-ID: <200211122349.gACNn5cX017668@arch20m.dellroad.org> In-Reply-To: <20021111112128.G52940@espresso.q9media.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> Marc Recht <marc@informatik.uni-bremen.de> writes:
> I've had the attached patch in my tree for a while. I'll try and get
> it and the <unistd.h> patch committed today.
static __inline void
__fd_zero(fd_set *p, __size_t n)
{
n = _howmany(n, _NFDBITS);
while (n > 0)
p->fds_bits[n--] = 0;
}
That looks broken. Maybe you meant this:
static __inline void
__fd_zero(fd_set *p, __size_t n)
{
n = _howmany(n, _NFDBITS);
while (n > 0)
p->fds_bits[--n] = 0;
}
But why not just this?
static __inline void
__fd_zero(fd_set *p, __size_t n)
{
memset(p->fds_bits, 0, _howmany(n, _NFDBITS));
}
-Archie
__________________________________________________________________________
Archie Cobbs * Packet Design * http://www.packetdesign.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200211122349.gACNn5cX017668>
