summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordm <>1997-06-04 03:18:41 +0000
committerdm <>1997-06-04 03:18:41 +0000
commit161d8df7af682a13bd4d1308df77eb4cb43aacdc (patch)
tree44b19f17eb7307764a8c4d083b626e3c46f540af /src
parentc48cc9eb9a5a61836503701757021fa09d76db41 (diff)
downloadopenbsd-161d8df7af682a13bd4d1308df77eb4cb43aacdc.tar.gz
openbsd-161d8df7af682a13bd4d1308df77eb4cb43aacdc.tar.bz2
openbsd-161d8df7af682a13bd4d1308df77eb4cb43aacdc.zip
use bzero instead of FD_ZERO
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/net/rcmd.c8
-rw-r--r--src/lib/libc/net/res_send.c9
2 files changed, 8 insertions, 9 deletions
diff --git a/src/lib/libc/net/rcmd.c b/src/lib/libc/net/rcmd.c
index 468c93eb63..00a554a0a2 100644
--- a/src/lib/libc/net/rcmd.c
+++ b/src/lib/libc/net/rcmd.c
@@ -34,7 +34,7 @@
34 */ 34 */
35 35
36#if defined(LIBC_SCCS) && !defined(lint) 36#if defined(LIBC_SCCS) && !defined(lint)
37static char *rcsid = "$OpenBSD: rcmd.c,v 1.22 1997/06/03 22:43:42 deraadt Exp $"; 37static char *rcsid = "$OpenBSD: rcmd.c,v 1.23 1997/06/04 03:18:40 dm Exp $";
38#endif /* LIBC_SCCS and not lint */ 38#endif /* LIBC_SCCS and not lint */
39 39
40#include <sys/param.h> 40#include <sys/param.h>
@@ -163,11 +163,11 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
163 char num[8]; 163 char num[8];
164 int s2 = rresvport(&lport), s3; 164 int s2 = rresvport(&lport), s3;
165 int len = sizeof(from); 165 int len = sizeof(from);
166 int fdssize = howmany(MAX(s, s2)+1, NFDBITS) * sizeof(fd_mask);
166 167
167 if (s2 < 0) 168 if (s2 < 0)
168 goto bad; 169 goto bad;
169 readsp = (fd_set *)malloc(howmany(MAX(s, s2)+1, NFDBITS) * 170 readsp = (fd_set *)malloc(fdssize);
170 sizeof(fd_mask));
171 if (readsp == NULL) 171 if (readsp == NULL)
172 goto bad; 172 goto bad;
173 listen(s2, 1); 173 listen(s2, 1);
@@ -180,7 +180,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
180 goto bad; 180 goto bad;
181 } 181 }
182again: 182again:
183 FD_ZERO(readsp); 183 bzero(readsp,fdssize);
184 FD_SET(s, readsp); 184 FD_SET(s, readsp);
185 FD_SET(s2, readsp); 185 FD_SET(s2, readsp);
186 errno = 0; 186 errno = 0;
diff --git a/src/lib/libc/net/res_send.c b/src/lib/libc/net/res_send.c
index 0456dc0cf1..b89398aab3 100644
--- a/src/lib/libc/net/res_send.c
+++ b/src/lib/libc/net/res_send.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: res_send.c,v 1.6 1997/06/03 22:43:43 deraadt Exp $ */ 1/* $OpenBSD: res_send.c,v 1.7 1997/06/04 03:18:41 dm Exp $ */
2 2
3/* 3/*
4 * ++Copyright++ 1985, 1989, 1993 4 * ++Copyright++ 1985, 1989, 1993
@@ -60,7 +60,7 @@
60static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93"; 60static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
61static char rcsid[] = "$From: res_send.c,v 8.12 1996/10/08 04:51:06 vixie Exp $"; 61static char rcsid[] = "$From: res_send.c,v 8.12 1996/10/08 04:51:06 vixie Exp $";
62#else 62#else
63static char rcsid[] = "$OpenBSD: res_send.c,v 1.6 1997/06/03 22:43:43 deraadt Exp $"; 63static char rcsid[] = "$OpenBSD: res_send.c,v 1.7 1997/06/04 03:18:41 dm Exp $";
64#endif 64#endif
65#endif /* LIBC_SCCS and not lint */ 65#endif /* LIBC_SCCS and not lint */
66 66
@@ -595,13 +595,12 @@ read_len:
595 timeout.tv_sec = 1; 595 timeout.tv_sec = 1;
596 timeout.tv_usec = 0; 596 timeout.tv_usec = 0;
597 wait: 597 wait:
598 dsmaskp = (fd_set *)malloc(howmany(s+1, NFDBITS) * 598 dsmaskp = (fd_set *)calloc(howmany(s+1, NFDBITS),
599 sizeof(fd_mask)); 599 sizeof(fd_mask));
600 if (dsmaskp == NULL) { 600 if (dsmaskp == NULL) {
601 res_close(); 601 res_close();
602 goto next_ns; 602 goto next_ns;
603 } 603 }
604 FD_ZERO(dsmaskp);
605 FD_SET(s, dsmaskp); 604 FD_SET(s, dsmaskp);
606 n = select(s+1, dsmaskp, (fd_set *)NULL, 605 n = select(s+1, dsmaskp, (fd_set *)NULL,
607 (fd_set *)NULL, &timeout); 606 (fd_set *)NULL, &timeout);