aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-04-15 18:40:16 +1000
committerDavid Walter Seikel2014-04-15 18:40:16 +1000
commit3d5c389507566a632593756e015866dd80bdaaaa (patch)
treeb77a94f260c07eb26f0f1c66c241d7085459be7e
parentMark the key / command mapping structure constant. (diff)
downloadboxes-3d5c389507566a632593756e015866dd80bdaaaa.zip
boxes-3d5c389507566a632593756e015866dd80bdaaaa.tar.gz
boxes-3d5c389507566a632593756e015866dd80bdaaaa.tar.bz2
boxes-3d5c389507566a632593756e015866dd80bdaaaa.tar.xz
Switch to xread, remove excess error checking stuff.
-rw-r--r--handlekeys.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/handlekeys.c b/handlekeys.c
index 7501dbd..4938039 100644
--- a/handlekeys.c
+++ b/handlekeys.c
@@ -247,16 +247,9 @@ void handle_keys(long extra, int (*handle_event)(long extra, struct keyevent *ev
247 } 247 }
248 else if ((0 < p) && FD_ISSET(0, &selectFds)) 248 else if ((0 < p) && FD_ISSET(0, &selectFds))
249 { 249 {
250 j = read(0, &buffer[buffIndex], sizeof(buffer) - (buffIndex + 1)); 250 j = xread(0, &buffer[buffIndex], sizeof(buffer) - (buffIndex + 1));
251 if (j < 0) perror_exit("input error"); 251 if (j == 0) // End of file.
252 else if (j == 0) // End of file.
253 {
254 stillRunning = 0; 252 stillRunning = 0;
255 fprintf(stderr, "EOF\n");
256 for (j = 0; buffer[j + 1]; j++)
257 fprintf(stderr, "(%x), ", (int) buffer[j]);
258 fflush(stderr);
259 }
260 else 253 else
261 { 254 {
262 buffIndex += j; 255 buffIndex += j;