aboutsummaryrefslogtreecommitdiff
path: root/powerdebug.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@free.fr>2011-03-26 22:06:16 +0100
committerAmit Kucheria <amit.kucheria@linaro.org>2011-04-04 03:07:57 +0300
commitca17a72ffd538c9e8a1832831ef8a4b6b3c17664 (patch)
tree5cc002e8298c594d74a8b6cc3a0ef586f97fd561 /powerdebug.c
parent3abd8b1d4565f19655f6e7fbd3a6fa4927beedc0 (diff)
downloadpowerdebug-ca17a72ffd538c9e8a1832831ef8a4b6b3c17664.tar.gz
Do more error check in display_init()
Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Diffstat (limited to 'powerdebug.c')
-rw-r--r--powerdebug.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/powerdebug.c b/powerdebug.c
index 8244df2..215b0fe 100644
--- a/powerdebug.c
+++ b/powerdebug.c
@@ -261,8 +261,9 @@ int mainloop(struct powerdebug_options *options,
struct timeval tval;
fd_set readfds;
- if (firsttime[0])
- display_init();
+ if (firsttime[0] && display_init())
+ return -1;
+
create_windows(options->selectedwindow);
show_header(options->selectedwindow);
@@ -395,6 +396,11 @@ int main(int argc, char **argv)
return 0;
}
+ if (display_init()) {
+ printf("failed to initialize display\n");
+ return 1;
+ }
+
if (mainloop(options, regulators_info, numregulators))
return 1;