From e5dcb864130a51a5ddd8563c372f89b010ad95d7 Mon Sep 17 00:00:00 2001 From: ps Date: Thu, 27 Apr 2006 19:01:54 +0000 Subject: With minidumps, the dumping partition could be smaller than physical memory, so checking the size of the partition is not necessary. Tested by: kris --- sbin/dumpon/dumpon.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sbin/dumpon/dumpon.c') diff --git a/sbin/dumpon/dumpon.c b/sbin/dumpon/dumpon.c index df6f88a..9bb5c7e 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) -- cgit v1.1