mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-30 08:43:23 +00:00
MFC: rev 1.40: trivial fix for savecore on 2GB+ ram machines
This commit is contained in:
parent
4479ee219f
commit
5fc8aceac5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/stable/3/; revision=77895
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user