diff options
Diffstat (limited to 'sbin/savecore/savecore.c')
-rw-r--r-- | sbin/savecore/savecore.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index 3dc4f14..b5b0d44 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -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"); |