From d9205a59df6eebe56042783a11129c7b21727ac8 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sun, 4 Dec 2011 15:04:06 +0100 Subject: [PATCH] The games now use the error(3) function. --- games/conway.cpp | 3 ++- games/pong.cpp | 3 ++- games/snake.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/games/conway.cpp b/games/conway.cpp index 2fdc61f7..d47d9254 100644 --- a/games/conway.cpp +++ b/games/conway.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include using namespace Maxsi; @@ -47,7 +48,7 @@ bool FlushVGA() int Init() { vgafd = open("/dev/vga", O_RDWR); - if ( vgafd < 0 ) { printf("Unable to open vga device: %s", strerror(errno)); return 1; } + if ( vgafd < 0 ) { error(0, errno, "unable to open vga device /dev/vga"); return 1; } Clear(); diff --git a/games/pong.cpp b/games/pong.cpp index 0df5e101..bd3ff331 100644 --- a/games/pong.cpp +++ b/games/pong.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include using namespace Maxsi; @@ -61,7 +62,7 @@ bool FlushVGA() int Init() { vgafd = open("/dev/vga", O_RDWR); - if ( vgafd < 0 ) { printf("Unable to open vga device: %s", strerror(errno)); return 1; } + if ( vgafd < 0 ) { error(0, errno, "unable to open vga device /dev/vga"); return 1; } Reset(); diff --git a/games/snake.cpp b/games/snake.cpp index de5eab0b..5e638998 100644 --- a/games/snake.cpp +++ b/games/snake.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include using namespace Maxsi; @@ -81,7 +82,7 @@ bool FlushVGA() int Init() { vgafd = open("/dev/vga", O_RDWR); - if ( vgafd < 0 ) { printf("Unable to open vga device: %s", strerror(errno)); return 1; } + if ( vgafd < 0 ) { error(0, errno, "unable to open vga device /dev/vga"); return 1; } Reset();