summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_disk.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-01-21 01:48:44 +0000
committertedu <tedu@openbsd.org>2014-01-21 01:48:44 +0000
commit91ba896db697da68a85cad0ccf0e596c2e766af5 (patch)
tree239fb63a3973e6123aad5b4c47ed9a2cc65139b8 /sys/kern/subr_disk.c
parentnaughty guenther didn't compile (diff)
downloadwireguard-openbsd-91ba896db697da68a85cad0ccf0e596c2e766af5.tar.xz
wireguard-openbsd-91ba896db697da68a85cad0ccf0e596c2e766af5.zip
bzero -> memset
Diffstat (limited to 'sys/kern/subr_disk.c')
-rw-r--r--sys/kern/subr_disk.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index fccc90c1a58..afc7464615b 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.159 2013/11/20 23:52:42 dlg Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.160 2014/01/21 01:48:44 tedu Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -571,15 +571,15 @@ setdisklabel(struct disklabel *olp, struct disklabel *nlp, u_int openmask)
/* Generate a UID if the disklabel does not already have one. */
uid = 0;
- if (bcmp(nlp->d_uid, &uid, sizeof(nlp->d_uid)) == 0) {
+ if (memcmp(nlp->d_uid, &uid, sizeof(nlp->d_uid)) == 0) {
do {
arc4random_buf(nlp->d_uid, sizeof(nlp->d_uid));
TAILQ_FOREACH(dk, &disklist, dk_link)
- if (dk->dk_label && bcmp(dk->dk_label->d_uid,
+ if (dk->dk_label && memcmp(dk->dk_label->d_uid,
nlp->d_uid, sizeof(nlp->d_uid)) == 0)
break;
} while (dk != NULL &&
- bcmp(nlp->d_uid, &uid, sizeof(nlp->d_uid)) == 0);
+ memcmp(nlp->d_uid, &uid, sizeof(nlp->d_uid)) == 0);
}
nlp->d_checksum = 0;
@@ -1102,8 +1102,8 @@ setroot(struct device *bootdv, int part, int exitflags)
}
/* Locate DUID for boot disk if not already provided. */
- bzero(duid, sizeof(duid));
- if (bcmp(bootduid, duid, sizeof(bootduid)) == 0) {
+ memset(duid, 0, sizeof(duid));
+ if (memcmp(bootduid, duid, sizeof(bootduid)) == 0) {
TAILQ_FOREACH(dk, &disklist, dk_link)
if (dk->dk_device == bootdv)
break;
@@ -1219,11 +1219,11 @@ gotswap:
rootdv = bootdv;
if (bootdv->dv_class == DV_DISK) {
- bzero(&duid, sizeof(duid));
- if (bcmp(rootduid, &duid, sizeof(rootduid)) != 0) {
+ memset(&duid, 0, sizeof(duid));
+ if (memcmp(rootduid, &duid, sizeof(rootduid)) != 0) {
TAILQ_FOREACH(dk, &disklist, dk_link)
if ((dk->dk_flags & DKF_LABELVALID) &&
- dk->dk_label && bcmp(dk->dk_label->d_uid,
+ dk->dk_label && memcmp(dk->dk_label->d_uid,
&rootduid, sizeof(rootduid)) == 0)
break;
if (dk == NULL)
@@ -1439,7 +1439,7 @@ disk_map(char *path, char *mappath, int size, int flags)
return -1;
/* Derive label UID. */
- bzero(uid, sizeof(uid));
+ memset(uid, 0, sizeof(uid));
for (i = 0; i < 16; i++) {
c = path[i];
if (c >= '0' && c <= '9')
@@ -1456,7 +1456,7 @@ disk_map(char *path, char *mappath, int size, int flags)
mdk = NULL;
TAILQ_FOREACH(dk, &disklist, dk_link) {
if ((dk->dk_flags & DKF_LABELVALID) && dk->dk_label &&
- bcmp(dk->dk_label->d_uid, uid,
+ memcmp(dk->dk_label->d_uid, uid,
sizeof(dk->dk_label->d_uid)) == 0) {
/* Fail if there are duplicate UIDs! */
if (mdk != NULL)