aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-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;