Tidy up the offset calculations.

Submitted by:	bde
This commit is contained in:
ps 2000-05-09 22:20:14 +00:00
parent 35ab0a3667
commit b87a84748a

View File

@ -217,7 +217,7 @@ kmem_setup()
const char *dump_sys;
int mib[2];
size_t len;
unsigned long kdumplo; /* where dump starts on dumpdev */
long kdumplo; /* block number where dump starts on dumpdev */
/*
* Some names we need for the currently running system, others for
@ -262,13 +262,12 @@ kmem_setup()
kmem = Open(_PATH_KMEM, O_RDONLY);
Lseek(kmem, (off_t)current_nl[X_DUMPLO].n_value, L_SET);
(void)Read(kmem, &kdumplo, sizeof(kdumplo));
dumplo = kdumplo;
dumplo = (off_t)kdumplo * DEV_BSIZE;
if (verbose)
(void)printf("dumplo = %ld (%ld * %d)\n",
dumplo, dumplo/DEV_BSIZE, DEV_BSIZE);
(void)printf("dumplo = %lld (%ld * %d)\n",
(long long)dumplo, kdumplo, DEV_BSIZE);
Lseek(kmem, (off_t)current_nl[X_DUMPMAG].n_value, L_SET);
(void)Read(kmem, &dumpmag, sizeof(dumpmag));
dumplo *= DEV_BSIZE;
ddname = find_dev(dumpdev);
dumpfd = Open(ddname, O_RDWR);
fp = fdopen(kmem, "r");