diff options
author | Paul Saab <ps@FreeBSD.org> | 2006-04-27 19:01:54 +0000 |
---|---|---|
committer | Paul Saab <ps@FreeBSD.org> | 2006-04-27 19:01:54 +0000 |
commit | ce893772bdbdda7b9c0c479c6aee9c7fe2a70689 (patch) | |
tree | 306ba28f47a613c877c28d48a0a628e47ade3584 /sbin/dumpon | |
parent | 5c06d111b8d7bd0079621d4685e62dc8ee2e7648 (diff) | |
download | src-ce893772bdbdda7b9c0c479c6aee9c7fe2a70689.tar.gz src-ce893772bdbdda7b9c0c479c6aee9c7fe2a70689.zip |
With minidumps, the dumping partition could be smaller than physical
memory, so checking the size of the partition is not necessary.
Tested by: kris
Notes
Notes:
svn path=/head/; revision=158083
Diffstat (limited to 'sbin/dumpon')
-rw-r--r-- | sbin/dumpon/dumpon.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sbin/dumpon/dumpon.c b/sbin/dumpon/dumpon.c index df6f88a7e632..9bb5c7e9deea 100644 --- a/sbin/dumpon/dumpon.c +++ b/sbin/dumpon/dumpon.c @@ -72,9 +72,16 @@ check_size(int fd, const char *fn) int name[] = { CTL_HW, HW_PHYSMEM }; size_t namelen = sizeof name / sizeof *name; unsigned long physmem; - size_t len = sizeof physmem; + size_t len; off_t mediasize; + int minidump; + + len = sizeof minidump; + if (sysctlbyname("debug.minidump", &minidump, &len, NULL, 0) == 0 && + minidump == 1) + return; + len = sizeof physmem; if (sysctl(name, namelen, &physmem, &len, NULL, 0) != 0) err(EX_OSERR, "can't get memory size"); if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) != 0) |