Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Revert src/sys/kern/subr_disk_mbr.c r.1.52
details: https://anonhg.NetBSD.org/src/rev/0a40d441169e
branches: trunk
changeset: 460885:0a40d441169e
user: kamil <kamil%NetBSD.org@localhost>
date: Thu Nov 07 18:35:41 2019 +0000
description:
Revert src/sys/kern/subr_disk_mbr.c r.1.52
Addressed in a better way in r. 1.53.
diffstat:
sys/kern/subr_disk_mbr.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diffs (32 lines):
diff -r 38ac3ee89868 -r 0a40d441169e sys/kern/subr_disk_mbr.c
--- a/sys/kern/subr_disk_mbr.c Thu Nov 07 18:30:27 2019 +0000
+++ b/sys/kern/subr_disk_mbr.c Thu Nov 07 18:35:41 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_disk_mbr.c,v 1.53 2019/11/07 18:30:27 kamil Exp $ */
+/* $NetBSD: subr_disk_mbr.c,v 1.54 2019/11/07 18:35:41 kamil Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_disk_mbr.c,v 1.53 2019/11/07 18:30:27 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk_mbr.c,v 1.54 2019/11/07 18:35:41 kamil Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -571,11 +571,8 @@
static bool
check_label_magic(const struct disklabel *dlp, uint32_t diskmagic)
{
-
- return memcmp((const char *)dlp + offsetof(struct disklabel, d_magic),
- &diskmagic, sizeof(diskmagic)) == 0 &&
- memcmp((const char *)dlp + offsetof(struct disklabel, d_magic2),
- &diskmagic, sizeof(diskmagic)) == 0;
+ return memcmp(&dlp->d_magic, &diskmagic, sizeof(diskmagic)) == 0 &&
+ memcmp(&dlp->d_magic2, &diskmagic, sizeof(diskmagic)) == 0;
}
#ifdef DISKLABEL_EI
Home |
Main Index |
Thread Index |
Old Index