From 832b64785c4343d5e885eac92e0f848ab1f4120c Mon Sep 17 00:00:00 2001 From: mlelstv Date: Mon, 11 Dec 2023 14:00:47 +0000 Subject: [PATCH] Implement cngetc, don't abort. --- usr.sbin/crash/crash.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/usr.sbin/crash/crash.c b/usr.sbin/crash/crash.c index dd4343e57928..0e4fc020f428 100644 --- a/usr.sbin/crash/crash.c +++ b/usr.sbin/crash/crash.c @@ -1,4 +1,4 @@ -/* $NetBSD: crash.c,v 1.15 2023/04/12 17:53:32 riastradh Exp $ */ +/* $NetBSD: crash.c,v 1.16 2023/12/11 14:00:47 mlelstv Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: crash.c,v 1.15 2023/04/12 17:53:32 riastradh Exp $"); +__RCSID("$NetBSD: crash.c,v 1.16 2023/12/11 14:00:47 mlelstv Exp $"); #endif /* not lint */ #include @@ -94,7 +94,6 @@ void lockdebug_lock_print(void) { } #endif - static void cleanup(void) { @@ -309,9 +308,11 @@ db_check_interrupt(void) int cngetc(void) { + char ch; - fprintf(stderr, "cngetc\n"); - abort(); + if (el_getc(elptr, &ch) <= 0) + return 0; + return (unsigned char)ch; } void