handle winch signal
- handle winch to display window properly
- bug: https://bugs.launchpad.net/linaro-powerdebug/+bug/827828
Signed-off-by: Sanjay Singh Rawat <sanjay.rawat@linaro.org>
diff --git a/powerdebug.c b/powerdebug.c
index 073fd42..098c5da 100644
--- a/powerdebug.c
+++ b/powerdebug.c
@@ -20,6 +20,7 @@
#include <stdio.h>
#include <errno.h>
#include <ncurses.h>
+#include <signal.h>
#include "regulator.h"
#include "display.h"
#include "clocks.h"
@@ -28,6 +29,8 @@
#include "mainloop.h"
#include "powerdebug.h"
+extern void sigwinch_handler(int);
+
void usage(void)
{
printf("Usage: powerdebug [OPTIONS]\n");
@@ -207,6 +210,7 @@
return NULL;
memset(options, 0, sizeof(*options));
+ signal(SIGWINCH, sigwinch_handler);
return options;
}