summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2002-10-14 05:38:22 +0000
committermarcel <marcel@FreeBSD.org>2002-10-14 05:38:22 +0000
commit7d6013f59f9b6abd27ff9dd8267724b561c37364 (patch)
tree86ea7b4a548212723a6048b5407f95c0beabe51a /sys
parentaf56ac88c7882988e85dd8b6f853699347cd8934 (diff)
downloadFreeBSD-src-7d6013f59f9b6abd27ff9dd8267724b561c37364.zip
FreeBSD-src-7d6013f59f9b6abd27ff9dd8267724b561c37364.tar.gz
Allow kernel dumps to be aborted with ctrl-C.
Diffstat (limited to 'sys')
-rw-r--r--sys/ia64/ia64/dump_machdep.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/ia64/ia64/dump_machdep.c b/sys/ia64/ia64/dump_machdep.c
index 060c759..2af310f 100644
--- a/sys/ia64/ia64/dump_machdep.c
+++ b/sys/ia64/ia64/dump_machdep.c
@@ -29,6 +29,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
+#include <sys/cons.h>
#include <sys/kernel.h>
#include <sys/kerneldump.h>
#include <vm/vm.h>
@@ -120,7 +121,7 @@ cb_dumpdata(EFI_MEMORY_DESCRIPTOR *mdp, int seqnr, void *arg)
vm_offset_t pa;
uint64_t pgs;
size_t counter, sz;
- int error, twiddle;
+ int c, error, twiddle;
error = 0; /* catch case in which mdp->NumberOfPages is 0 */
counter = 0; /* Update twiddle every 16MB */
@@ -144,6 +145,13 @@ cb_dumpdata(EFI_MEMORY_DESCRIPTOR *mdp, int seqnr, void *arg)
dumplo += sz;
pgs -= sz >> EFI_PAGE_SHIFT;
pa += sz;
+
+ /* Check for user abort. */
+ c = cncheckc();
+ if (c == 0x03)
+ return (ECANCELED);
+ if (c != -1)
+ printf("(CTRL-C to abort) ");
}
printf("... %s\n", (error) ? "fail" : "ok");
return (error);
@@ -295,6 +303,9 @@ dumpsys(struct dumperinfo *di)
fail:
if (error < 0)
error = -error;
- /* XXX It should look more like VMS :-) */
- printf("** DUMP FAILED (ERROR %d) **\n", error);
+
+ if (error == ECANCELED)
+ printf("\nDump aborted\n");
+ else
+ printf("\n** DUMP FAILED (ERROR %d) **\n", error);
}
OpenPOWER on IntegriCloud