From 707e509a1e1d79fb387c3480fd8a67d40e4e2db7 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 16 Mar 2004 17:07:06 +0000 Subject: Change libdisk and sysinstall to use d_addr_t rather than u_long for disk addresses. For arch's with 64-bit longs, this is a nop, but for i386 this allows sysinstall to properly handle disks and filesystems > 1 TB. Changes from the original patch include: - Use d_addr_t rather than inventing a blkcnt type based on int64_t. - Use strtoimax() rather than strtoull() to parse d_addr_t's from config files. - Use intmax_t casts and %jd rather than %llu to printf d_addr_t values. Tested on: i386 Tested by: kuriyama Submitted by: julian MFC after: 1 month --- lib/libdisk/open_disk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libdisk/open_disk.c') diff --git a/lib/libdisk/open_disk.c b/lib/libdisk/open_disk.c index 99abba500eeb..b0d4ac73aef8 100644 --- a/lib/libdisk/open_disk.c +++ b/lib/libdisk/open_disk.c @@ -45,9 +45,9 @@ Int_Open_Disk(const char *name, char *conftxt) struct disk *d; int i; char *p, *q, *r, *a, *b, *n, *t, *sn; - off_t o, len, off; + daddr_t o, len, off; u_int l, s, ty, sc, hd, alt; - off_t lo[10]; + daddr_t lo[10]; for (p = conftxt; p != NULL && *p; p = strchr(p, '\n')) { if (*p == '\n') @@ -103,7 +103,7 @@ Int_Open_Disk(const char *name, char *conftxt) if (a == NULL) break; b = strsep(&p, " "); - o = strtoul(b, &r, 0); + o = strtoimax(b, &r, 0); if (*r) { printf("BARF %d <%d>\n", __LINE__, *r); exit (0); -- cgit v1.3