summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ifpps.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ifpps.c b/ifpps.c
index 2d64849..2b3ef9d 100644
--- a/ifpps.c
+++ b/ifpps.c
@@ -1127,6 +1127,12 @@ static void screen_update(WINDOW *screen, const char *ifname, const struct ifsta
refresh();
}
+static void on_panic_handler(void *arg)
+{
+ screen_end();
+ fprintf(stderr, "Please check <stderr> for error message\n");
+}
+
static int screen_main(const char *ifname, uint64_t ms_interval,
unsigned int top_cpus, bool suppress_warnings,
bool omit_header __maybe_unused)
@@ -1137,6 +1143,8 @@ static int screen_main(const char *ifname, uint64_t ms_interval,
stats_screen = screen_init(true);
+ panic_handler_add(on_panic_handler, NULL);
+
if (((rate > SPEED_1000 && ms_interval <= 1000) ||
(rate = SPEED_1000 && ms_interval < 1000)) &&
!suppress_warnings)