diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 1999-08-29 14:54:11 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 1999-08-29 14:54:11 +0000 |
commit | c5b072197a1de72e9d3ff9e43e6f0fdb13a9f909 (patch) | |
tree | c7d860bfe8658e6dda2378d303041f71f69783e1 /sys | |
parent | f5988870ceecd4611871e459cc59a2e0dd1111ce (diff) | |
download | src-c5b072197a1de72e9d3ff9e43e6f0fdb13a9f909.tar.gz src-c5b072197a1de72e9d3ff9e43e6f0fdb13a9f909.zip |
Remove unneeded "maj" variable.
Give up if we have already started dumping once before.
Print name of dumpdev.
Notes
Notes:
svn path=/head/; revision=50571
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_shutdown.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 5cd4f85135d5..432ed93cda63 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -376,14 +376,13 @@ static int setdumpdev(dev) dev_t dev; { - int maj, psize; + int psize; long newdumplo; if (dev == NODEV) { dumpdev = dev; return (0); } - maj = major(dev); if (devsw(dev) == NULL) return (ENXIO); /* XXX is this right? */ if (devsw(dev)->d_psize == NULL) @@ -392,8 +391,7 @@ setdumpdev(dev) if (psize == -1) return (ENXIO); /* XXX should be ENODEV ? */ /* - * XXX should clean up checking in dumpsys() to be more like this, - * and nuke dodump sysctl (too many knobs). + * XXX should clean up checking in dumpsys() to be more like this. */ newdumplo = psize - Maxmem * PAGE_SIZE / DEV_BSIZE; if (newdumplo < 0) @@ -441,7 +439,12 @@ static void dumpsys(void) { int error; + static int dumping; + if (dumping++) { + printf("Dump already in progress, bailing...\n"); + return; + } if (!dodump) return; if (dumpdev == NODEV) @@ -451,8 +454,7 @@ dumpsys(void) if (!(devsw(dumpdev)->d_dump)) return; dumpsize = Maxmem; - printf("\ndumping to dev (%d,%d), offset %ld\n", - major(dumpdev), minor(dumpdev), dumplo); + printf("\ndumping to dev %s, offset %ld\n", devtoname(dumpdev), dumplo); printf("dump "); error = (*devsw(dumpdev)->d_dump)(dumpdev); if (error == 0) { |