Skip to content

Commit

Permalink
Check that display was opened successfully.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewFromMelbourne committed Jan 21, 2016
1 parent caa4068 commit 808fb02
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions raspi2png.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ main(
DISPMANX_DISPLAY_HANDLE_T displayHandle
= vc_dispmanx_display_open(displayNumber);

if (displayHandle == 0)
{
fprintf(stderr, "%s: unable to open display\n", program);
exit(EXIT_FAILURE);
}

DISPMANX_MODEINFO_T modeInfo;
result = vc_dispmanx_display_get_info(displayHandle, &modeInfo);

Expand Down

0 comments on commit 808fb02

Please sign in to comment.