MFC: rev 1.40: trivial fix for savecore on 2GB+ ram machines

This commit is contained in:
Peter Wemm 2001-06-08 03:14:05 +00:00
parent 4479ee219f
commit 5fc8aceac5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/3/; revision=77895

View File

@ -101,7 +101,7 @@ struct nlist dump_nl[] = { /* Name list for dumped system. */
/* Types match kernel declarations. */
off_t dumplo; /* where dump starts on dumpdev */
int dumpmag; /* magic number in dump */
int dumpsize; /* amount of memory dumped */
off_t dumpsize; /* amount of memory dumped */
char *kernel;
char *dirname; /* directory to save dumps in */
@ -536,10 +536,12 @@ get_crashtime()
void
get_dumpsize()
{
unsigned int dumppages;
/* Read the dump size. */
Lseek(dumpfd, (off_t)(dumplo + ok(dump_nl[X_DUMPSIZE].n_value)), L_SET);
(void)Read(dumpfd, &dumpsize, sizeof(dumpsize));
dumpsize *= getpagesize();
(void)Read(dumpfd, &dumppages, sizeof(dumppages));
dumpsize = dumppages * getpagesize();
}
int