From fec275a4a8e9ecd77fb30c4a242a2fe832d9f41c Mon Sep 17 00:00:00 2001 From: Chris Davis Date: Tue, 1 Jul 2014 16:00:16 -0700 Subject: [PATCH] regedit: add a panic handler to restore terminal Signed-off-by: Chris Davis Reviewed-by: Andreas Schneider Reviewed-by: Michael Adam --- source3/utils/regedit.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source3/utils/regedit.c b/source3/utils/regedit.c index 8fca96bd18d..5b7885ca3e1 100644 --- a/source3/utils/regedit.c +++ b/source3/utils/regedit.c @@ -567,6 +567,12 @@ int regedit_getch(void) return c; } +static void regedit_panic_handler(const char *msg) +{ + endwin(); + smb_panic_s3(msg); +} + static void display_window(TALLOC_CTX *mem_ctx, struct registry_context *ctx) { struct regedit *regedit; @@ -579,6 +585,8 @@ static void display_window(TALLOC_CTX *mem_ctx, struct registry_context *ctx) cbreak(); noecho(); + fault_configure(regedit_panic_handler); + colors = has_colors(); if (colors) { start_color(); -- 2.11.4.GIT