From: Vadim Kochan <[email protected]>
Clean up ncurses screen when panic was caused.
There will be limitation that error message
will be printed on stderr after ncurses cleanup
so it will be needed now to use redirect to error file:
ifpps -d <dev> 2> /tmp/err
to see error message.
Signed-off-by: Vadim Kochan <[email protected]>
---
ifpps.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/ifpps.c b/ifpps.c
index e70e8a6..791e662 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)
--
2.4.2
--
You received this message because you are subscribed to the Google Groups
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.