From: Scott Leggett <scott@sl.id.au>
Date: Mon, 5 Nov 2012 02:59:35 +1100
Subject: Fix hardening errors from unused result.

---
 spout.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/spout.c b/spout.c
index a53e364..464e2ac 100644
--- a/spout.c
+++ b/spout.c
@@ -107,8 +107,12 @@ void pceAppInit(void)
 	{
 		int fa;
 		if((fa = open(score_path, O_RDONLY)) != -1) {
-			read (fa, (void *) hiScore, 8);
-			close(fa);
+			if(read (fa, (void *) hiScore, 8) != -1) {
+                close(fa);
+            } else {
+                perror("read");
+                exit(EXIT_FAILURE);
+            }
 		}
 	}
 
@@ -145,8 +149,12 @@ void pceAppProc(int cnt)
 				hiScore[0] = score;
 				hiScore[1] = height;
 				if((fa = open(score_path, O_CREAT | O_WRONLY | O_TRUNC)) != -1) {
-					write(fa, (void *) hiScore, 8);
-					close(fa);
+					if(write(fa, (void *) hiScore, 8) != -1) {
+                        close(fa);
+                    } else {
+                        perror("write");
+                        exit(EXIT_FAILURE);
+                    }
 				}
 			}
 		} else {
