$NetBSD$

* DragonFly BSD's partinfo is not the standard BSD partinfo.

--- blkdev.c.orig	2011-01-09 11:55:42.000000000 +0000
+++ blkdev.c
@@ -44,10 +44,15 @@
 # endif
 #endif
 
-#ifdef HAVE_SYS_DISKLABEL_H
+#ifdef __DragonFly__
+# include <sys/diskslice.h>
+# define BSD_BLKDEV
+#else
+#ifdef HAVE_SYS_DISKLABEL_H)
 # include <sys/disklabel.h>
 # define BSD_BLKDEV
 #endif
+#endif
 
 #ifndef LINUX_BLKDEV
 # ifndef BSD_BLKDEV
@@ -181,14 +186,20 @@ public int destroy_blkdev(struct file_s 
       options.sectors = tmp;
 #endif
 
-#ifdef BSD_BLKDEV
+#if defined(BSD_BLKDEV)
+# if defined(__DragonFly__)
+      options.sectors = pinfo.media_blocks;
+# else
       options.sectors = pinfo.part->p_size;
+# endif
 #endif
     }
 
   if (options.sector_size == 0)
     {
-#ifdef BSD_BLKDEV
+#if defined(__DragonFly__)
+      options.sector_size = pinfo.media_blocks;
+#elif defined(BSD_BLKDEV)
       options.sector_size = pinfo.disklab->d_secsize;
 #else
       options.sector_size = SECTOR_SIZE;
