Author: pjd
Date: Mon Sep  7 14:44:04 2009
New Revision: 196928
URL: http://svn.freebsd.org/changeset/base/196928

Log:
  Teach zdb(8) how to obtain GEOM provider size.
  
  PR:           kern/133134
  Reported by:  Philipp Wuensche <cryx-free...@h3q.com>
  MFC after:    3 days

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Sep  7 14:16:50 2009        
(r196927)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Sep  7 14:44:04 2009        
(r196928)
@@ -1322,6 +1322,14 @@ dump_label(const char *dev)
                exit(1);
        }
 
+       if (S_ISCHR(statbuf.st_mode)) {
+               if (ioctl(fd, DIOCGMEDIASIZE, &statbuf.st_size) == -1) {
+                       (void) printf("failed to get size of '%s': %s\n", dev,
+                           strerror(errno));
+                       exit(1);
+               }
+       }
+
        psize = statbuf.st_size;
        psize = P2ALIGN(psize, (uint64_t)sizeof (vdev_label_t));
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to