summaryrefslogtreecommitdiffstats
path: root/lib/libutil/imsg.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-07-12 18:40:49 +0000
committernicm <nicm@openbsd.org>2015-07-12 18:40:49 +0000
commit3c3844617c581d3f2bbb214b66dbbec3dc4a82c0 (patch)
treed62630378231fcf88b93b76e3fe7f9155da66a7d /lib/libutil/imsg.c
parentConvert openssl(1) dsaparam to the new option handling. (diff)
downloadwireguard-openbsd-3c3844617c581d3f2bbb214b66dbbec3dc4a82c0.tar.xz
wireguard-openbsd-3c3844617c581d3f2bbb214b66dbbec3dc4a82c0.zip
Use memset instead of bzero for better portability.
ok gilles claudio doug
Diffstat (limited to 'lib/libutil/imsg.c')
-rw-r--r--lib/libutil/imsg.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libutil/imsg.c b/lib/libutil/imsg.c
index cbb0882118c..8fb349273f2 100644
--- a/lib/libutil/imsg.c
+++ b/lib/libutil/imsg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imsg.c,v 1.8 2015/07/03 14:50:14 brynet Exp $ */
+/* $OpenBSD: imsg.c,v 1.9 2015/07/12 18:40:49 nicm Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -36,7 +36,7 @@ void
imsg_init(struct imsgbuf *ibuf, int fd)
{
msgbuf_init(&ibuf->w);
- bzero(&ibuf->r, sizeof(ibuf->r));
+ memset(&ibuf->r, 0, sizeof(ibuf->r));
ibuf->fd = fd;
ibuf->w.fd = fd;
ibuf->pid = getpid();
@@ -57,8 +57,8 @@ imsg_read(struct imsgbuf *ibuf)
int fd;
struct imsg_fd *ifd;
- bzero(&msg, sizeof(msg));
- bzero(&cmsgbuf, sizeof(cmsgbuf));
+ memset(&msg, 0, sizeof(msg));
+ memset(&cmsgbuf, 0, sizeof(cmsgbuf));
iov.iov_base = ibuf->r.buf + ibuf->r.wpos;
iov.iov_len = sizeof(ibuf->r.buf) - ibuf->r.wpos;
@@ -78,7 +78,7 @@ again:
free(ifd);
return (-1);
}
-
+
if ((n = recvmsg(ibuf->fd, &msg, 0)) == -1) {
if (errno == EMSGSIZE)
goto fail;