From 1892fe18b501fd71d7dc6d3d4ad78bba983ed879 Mon Sep 17 00:00:00 2001 From: deraadt Date: Thu, 22 Jun 2017 01:26:28 +0000 Subject: [PATCH] Only print the magic '&' letter on a disk if the hibernate partition is valid. This is an undocumented little debugging diagnostic, much like the '*'. --- sys/arch/amd64/stand/libsa/diskprobe.c | 8 +++++--- sys/arch/i386/stand/libsa/diskprobe.c | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/arch/amd64/stand/libsa/diskprobe.c b/sys/arch/amd64/stand/libsa/diskprobe.c index 48dfb619840..507bca661c9 100644 --- a/sys/arch/amd64/stand/libsa/diskprobe.c +++ b/sys/arch/amd64/stand/libsa/diskprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskprobe.c,v 1.18 2017/06/19 22:50:50 deraadt Exp $ */ +/* $OpenBSD: diskprobe.c,v 1.19 2017/06/22 01:26:28 deraadt Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -489,7 +489,9 @@ check_hibernate(struct diskinfo *dip) (sizeof(union hibernate_info) / DEV_BSIZE); error = dip->strategy(dip, F_READ, (daddr32_t)sec, sizeof hib, &hib, NULL); - if (error == 0 && hib.magic == HIBERNATE_MAGIC) /* Hibernate present */ + if (error == 0 && hib.magic == HIBERNATE_MAGIC) { + /* Hibernate present */ dip->bios_info.flags |= BDI_HIBVALID; - printf("&"); + printf("&"); + } } diff --git a/sys/arch/i386/stand/libsa/diskprobe.c b/sys/arch/i386/stand/libsa/diskprobe.c index 2d30b9d859b..314b3f70aa5 100644 --- a/sys/arch/i386/stand/libsa/diskprobe.c +++ b/sys/arch/i386/stand/libsa/diskprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskprobe.c,v 1.42 2017/06/19 22:50:50 deraadt Exp $ */ +/* $OpenBSD: diskprobe.c,v 1.43 2017/06/22 01:26:28 deraadt Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -489,7 +489,9 @@ check_hibernate(struct diskinfo *dip) (sizeof(union hibernate_info) / DEV_BSIZE); error = dip->strategy(dip, F_READ, (daddr32_t)sec, sizeof hib, &hib, NULL); - if (error == 0 && hib.magic == HIBERNATE_MAGIC) /* Hibernate present */ + if (error == 0 && hib.magic == HIBERNATE_MAGIC) { + /* Hibernate present */ dip->bios_info.flags |= BDI_HIBVALID; - printf("&"); + printf("&"); + } } -- 2.20.1