aboutsummaryrefslogtreecommitdiff
path: root/powerdebug.c
diff options
context:
space:
mode:
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;