summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/disklabel/editor.c7
-rw-r--r--sbin/fdisk/disk.c7
-rw-r--r--sys/arch/vax/mscp/mscp_disk.c3
3 files changed, 8 insertions, 9 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index cf23efbefe5..3a4be86240e 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.257 2011/07/05 17:38:54 krw Exp $ */
+/* $OpenBSD: editor.c,v 1.258 2011/07/05 21:39:08 krw Exp $ */
/*
* Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -2183,9 +2183,8 @@ get_geometry(int f, struct disklabel **dgpp)
/* Get disk geometry */
if ((disk_geop = calloc(1, sizeof(struct disklabel))) == NULL)
errx(4, "out of memory");
- if (ioctl(f, DIOCGPDINFO, disk_geop) < 0 &&
- ioctl(f, DIOCGDINFO, disk_geop) < 0)
- err(4, "ioctl DIOCGDINFO");
+ if (ioctl(f, DIOCGPDINFO, disk_geop) < 0)
+ err(4, "ioctl DIOCGPDINFO");
*dgpp = disk_geop;
}
diff --git a/sbin/fdisk/disk.c b/sbin/fdisk/disk.c
index a77ba5ae6dc..b81da950cdf 100644
--- a/sbin/fdisk/disk.c
+++ b/sbin/fdisk/disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disk.c,v 1.31 2010/06/30 22:53:41 krw Exp $ */
+/* $OpenBSD: disk.c,v 1.32 2011/07/05 21:39:09 krw Exp $ */
/*
* Copyright (c) 1997, 2001 Tobias Weingartner
@@ -77,9 +77,8 @@ DISK_getlabelmetrics(char *name)
if (lm == NULL)
err(1, NULL);
- if (ioctl(fd, DIOCGPDINFO, &dl) == -1 &&
- ioctl(fd, DIOCGDINFO, &dl) == -1) {
- warn("DIOCGDINFO");
+ if (ioctl(fd, DIOCGPDINFO, &dl) == -1) {
+ warn("DIOCGPDINFO");
free(lm);
lm = NULL;
} else {
diff --git a/sys/arch/vax/mscp/mscp_disk.c b/sys/arch/vax/mscp/mscp_disk.c
index 39503d88151..b4cb3da23f3 100644
--- a/sys/arch/vax/mscp/mscp_disk.c
+++ b/sys/arch/vax/mscp/mscp_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mscp_disk.c,v 1.35 2011/06/05 18:40:33 matthew Exp $ */
+/* $OpenBSD: mscp_disk.c,v 1.36 2011/07/05 21:39:08 krw Exp $ */
/* $NetBSD: mscp_disk.c,v 1.30 2001/11/13 07:38:28 lukem Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
@@ -689,6 +689,7 @@ rxioctl(dev, cmd, data, flag, p)
switch (cmd) {
case DIOCGDINFO:
+ case DIOCGPDINFO: /* no separate 'physical' info available. */
bcopy(lp, data, sizeof (struct disklabel));
break;