diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2011-07-05 21:39:10 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2011-07-05 21:39:10 +0000 |
commit | 32166eacc937d86c26a20762d48df076a173062f (patch) | |
tree | cd7a083f87c45c12e9113922988311a88b76cb27 /sbin | |
parent | 6ff4286249e49d5a8bb0c1d374248073d68668e5 (diff) |
Add DIOCGPDINFO to rxioctl(), as a synonym for DIOCGDINFO, the last
place it was missing. Delete now redundant calls to DIOCGDINFO when
getting physical disk info in disklabel(8) and fdisk(8).
Reminded by a fdisk discussion with Andres Perera on tech@.
ok deraadt@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/disklabel/editor.c | 7 | ||||
-rw-r--r-- | sbin/fdisk/disk.c | 7 |
2 files changed, 6 insertions, 8 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 { |