aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog7
-rw-r--r--display.c9
-rw-r--r--powerdebug.c6
-rw-r--r--powerdebug.h2
-rw-r--r--regulator.c4
-rw-r--r--tree.c4
6 files changed, 27 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog
index 31937d4..192cc29 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+powerdebug (0.6.3-2013.04-0) precise; urgency=low
+
+ * fixed lp: 1014667
+ * fixed lp: 827828
+
+ -- Sanjay Singh Rawat <sanjay.rawat@linaro.org> Wed, 17 Apr 2013 15:55:32 +0530
+
powerdebug (0.6.2-2013.02-0) precise; urgency=low
* fixed lp: 1068108
diff --git a/display.c b/display.c
index f06387c..e9f4bf6 100644
--- a/display.c
+++ b/display.c
@@ -137,6 +137,11 @@ int display_refresh_pad(int win)
0, 2, 0, maxy - 2, maxx);
}
+void sigwinch_handler(int signo)
+{
+ display_refresh(current_win, true);
+}
+
static int display_show_unselection(int win, int line, bool bold)
{
if (mvwchgat(windata[win].pad, line, 0, -1,
@@ -593,8 +598,10 @@ int display_register(int win, struct display_ops *ops)
{
size_t array_size = sizeof(windata) / sizeof(windata[0]);
- if (win < 0 || win >= array_size)
+ if (win < 0 || win >= array_size) {
+ printf("error: invalid window");
return -1;
+ }
windata[win].ops = ops;
diff --git a/powerdebug.c b/powerdebug.c
index 073fd42..6cf3a1b 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 @@ static struct powerdebug_options *powerdebug_init(void)
return NULL;
memset(options, 0, sizeof(*options));
+ signal(SIGWINCH, sigwinch_handler);
return options;
}
@@ -243,7 +247,7 @@ int main(int argc, char **argv)
}
if (regulator_init()) {
- printf("not enough memory to allocate regulators info\n");
+ printf("failed to initialize regulator\n");
options->regulators = false;
}
diff --git a/powerdebug.h b/powerdebug.h
index e2c1699..642d4e4 100644
--- a/powerdebug.h
+++ b/powerdebug.h
@@ -13,4 +13,4 @@
* - initial API and implementation
*******************************************************************************/
-#define VERSION "0.6.2"
+#define VERSION "0.6.3"
diff --git a/regulator.c b/regulator.c
index 0da924a..68c686f 100644
--- a/regulator.c
+++ b/regulator.c
@@ -218,8 +218,10 @@ static int fill_regulator_cb(struct tree *t, void *data)
struct regulator_info *reg;
reg = regulator_alloc();
- if (!reg)
+ if (!reg) {
+ printf("error: unable to allocate memory for regulator\n");
return -1;
+ }
t->private = reg;
/* we skip the root node but we set it expanded for its children */
diff --git a/tree.c b/tree.c
index d331c60..686e846 100644
--- a/tree.c
+++ b/tree.c
@@ -121,8 +121,10 @@ static int tree_scan(struct tree *tree, tree_filter_t filter, bool follow)
int ret = 0;
dir = opendir(tree->path);
- if (!dir)
+ if (!dir) {
+ printf("error: unable to open directory %s\n", tree->path);
return -1;
+ }
while (!readdir_r(dir, &dirent, &direntp)) {