diff options
Diffstat (limited to 'sysutils/gpart/patches/patch-aa')
-rw-r--r-- | sysutils/gpart/patches/patch-aa | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/sysutils/gpart/patches/patch-aa b/sysutils/gpart/patches/patch-aa index 2e5c856a06d..1ac6c5f89e1 100644 --- a/sysutils/gpart/patches/patch-aa +++ b/sysutils/gpart/patches/patch-aa @@ -1,8 +1,8 @@ -$NetBSD: patch-aa,v 1.2 2006/03/24 12:35:19 joerg Exp $ +$NetBSD: patch-aa,v 1.3 2008/12/26 20:23:45 hasso Exp $ ---- src/disku.c Sun May 14 14:04:23 2000 -+++ src/disku.c Sun Jul 16 10:58:08 2000 -@@ -25,7 +25,7 @@ +--- src/disku.c.orig 2001-02-07 21:04:07 +0200 ++++ src/disku.c 2008-12-25 21:25:33 +0200 +@@ -26,12 +26,14 @@ #include <linux/hdreg.h> #endif @@ -11,12 +11,29 @@ $NetBSD: patch-aa,v 1.2 2006/03/24 12:35:19 joerg Exp $ #include <errno.h> #include <sys/disklabel.h> #endif -@@ -52,7 +52,7 @@ + +- ++#ifdef __DragonFly__ ++#include <sys/disklabel32.h> ++#endif + + /* + * get disk geometry. The medium is opened for reading, +@@ -60,10 +62,16 @@ struct disk_geom *disk_geometry(disk_des #endif -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) ++#ifdef __DragonFly__ ++ struct disklabel32 dl; ++ if (ioctl(d->d_fd,DIOCGDINFO32,&dl) == -1) ++ pr(FATAL,EM_IOCTLFAILED,"DIOCGDINFO32",strerror(errno)); ++#else struct disklabel dl; if (ioctl(d->d_fd,DIOCGDINFO,&dl) == -1) pr(FATAL,EM_IOCTLFAILED,"DIOCGDINFO",strerror(errno)); ++#endif + g.d_c = dl.d_ncylinders; + g.d_h = dl.d_ntracks; + g.d_s = dl.d_nsectors; |