[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH] fdisk: fix sector_t for multi-terabyte disks
From:       John Spencer <maillist-busybox () barfooze ! de>
Date:       2013-11-21 20:44:37
Message-ID: 528E70B5.6000101 () barfooze ! de
[Download RAW message or body]

From 8290bae43ae7a7fc71c0228d18b77db24faea764 Mon Sep 17 00:00:00 2001
From: John Spencer <maillist-busybox@barfooze.de>
Date: Thu, 21 Nov 2013 21:38:10 +0100
Subject: [PATCH] fdisk: fix sector_t for multi-terabyte disks

before:
Disk /dev/sdb: 4294967295 sectors, 4095M

after:
Disk /dev/sdb: 5860533168 sectors, 2794G

Signed-off-by: John Spencer <maillist-busybox@barfooze.de>
---
 util-linux/fdisk.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c
index 39eb27b..a21f62f 100644
--- a/util-linux/fdisk.c
+++ b/util-linux/fdisk.c
@@ -85,17 +85,8 @@ enum {
 
 
 typedef unsigned long long ullong;
-/* Used for sector numbers. Partition formats we know
- * do not support more than 2^32 sectors
- */
-typedef uint32_t sector_t;
-#if UINT_MAX == 4294967295
-# define SECT_FMT ""
-#elif ULONG_MAX == 4294967295
-# define SECT_FMT "l"
-#else
-# error Cant detect sizeof(uint32_t)
-#endif
+typedef uint64_t sector_t;
+#define SECT_FMT "ll"
 
 struct hd_geometry {
 	unsigned char heads;
-- 
1.8.4

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic