Use memset instead of bzero to clear xports array.
To be strictly conforming, we should iterate through the array and set each pointer to NULL. But memset is faster, and can be inlined by the compiler. If we ever encounter a machine where a NULL ptr != all bits zero, we'll have to handle this differently.
This commit is contained in:
parent
7d279a797f
commit
b18369b1bb
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: svc.c,v 1.8 1996/05/16 22:52:21 pk Exp $ */
|
||||
/* $NetBSD: svc.c,v 1.9 1996/05/17 00:32:22 jtc Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
@ -32,7 +32,7 @@
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
/*static char *sccsid = "from: @(#)svc.c 1.44 88/02/08 Copyr 1984 Sun Micro";*/
|
||||
/*static char *sccsid = "from: @(#)svc.c 2.4 88/08/11 4.0 RPCSRC";*/
|
||||
static char *rcsid = "$NetBSD: svc.c,v 1.8 1996/05/16 22:52:21 pk Exp $";
|
||||
static char *rcsid = "$NetBSD: svc.c,v 1.9 1996/05/17 00:32:22 jtc Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -88,7 +88,7 @@ xprt_register(xprt)
|
||||
if (xports == NULL) {
|
||||
xports = (SVCXPRT **)
|
||||
mem_alloc(FD_SETSIZE * sizeof(SVCXPRT *));
|
||||
bzero(xports, FD_SETSIZE * sizeof(SVCXPRT *));
|
||||
memset(xports, '\0', FD_SETSIZE * sizeof(SVCXPRT *));
|
||||
}
|
||||
if (sock < FD_SETSIZE) {
|
||||
xports[sock] = xprt;
|
||||
|
Loading…
Reference in New Issue
Block a user