1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-28 11:57:28 +00:00

dumpmag is 'u_long dumpmag' in the kernel, not 'int'. If this worked on

the Alpha, it was because of luck that it was little endian.

Tidy up the dumpsize/dumppages confusion and the out of date comments.
This commit is contained in:
Peter Wemm 2001-06-09 01:41:03 +00:00
parent 4088069c3a
commit 9b0a8ba37a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=77927

View File

@ -102,8 +102,10 @@ struct nlist dump_nl[] = { /* Name list for dumped system. */
};
/* Types match kernel declarations. */
u_long dumpmag; /* magic number in dump */
/* Based on kernel variables, but with more convenient types. */
off_t dumplo; /* where dump starts on dumpdev */
int dumpmag; /* magic number in dump */
off_t dumpsize; /* amount of memory dumped */
char *kernel; /* user-specified kernel */
@ -579,12 +581,12 @@ get_crashtime()
void
get_dumpsize()
{
unsigned int dumppages;
int kdumpsize;
/* Read the dump size. */
DumpRead(dumpfd, &dumppages, sizeof(dumppages),
DumpRead(dumpfd, &kdumpsize, sizeof(kdumpsize),
(off_t)(dumplo + ok(dump_nl[X_DUMPSIZE].n_value)), L_SET);
dumpsize = dumppages * getpagesize();
dumpsize = kdumpsize * getpagesize();
}
/*