From aa4e796168872805742405e8b14910efc5c4eaa8 Mon Sep 17 00:00:00 2001 From: okuji Date: Thu, 7 Sep 2000 10:30:09 +0000 Subject: [PATCH] fix a bug in lib/device.c. --- ChangeLog | 8 ++++++++ lib/device.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0bf5d06ca..f0246c640 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-09-07 OKUJI Yoshinori + + From Hal Snyder : + * lib/device.c (get_drive_geometry) [__FreeBSD__ || __NetBSD__ + || __OpenBSD__]: Call ioctl for FD instead of + DISKS[DRIVE].FLAGS. This was a mistake when I segregated this + function from asmstub.c. + 2000-09-07 Alessandro Rubini * docs/tutorial.texi: Fixed a few typos and minor imprecisions. diff --git a/lib/device.c b/lib/device.c index 2c91b515c..f35b1f926 100644 --- a/lib/device.c +++ b/lib/device.c @@ -99,7 +99,7 @@ get_drive_geometry (struct geometry *geom, char **map, int drive) /* FreeBSD, NetBSD or OpenBSD */ { struct disklabel hdg; - if (ioctl (disks[drive].flags, DIOCGDINFO, &hdg)) + if (ioctl (fd, DIOCGDINFO, &hdg)) goto fail; geom->cylinders = hdg.d_ncylinders;