diff options
author | David Walter Seikel | 2014-04-15 18:40:16 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-04-15 18:40:16 +1000 |
commit | 3d5c389507566a632593756e015866dd80bdaaaa (patch) | |
tree | b77a94f260c07eb26f0f1c66c241d7085459be7e /handlekeys.c | |
parent | Mark the key / command mapping structure constant. (diff) | |
download | opensim-SC_OLD-3d5c389507566a632593756e015866dd80bdaaaa.zip opensim-SC_OLD-3d5c389507566a632593756e015866dd80bdaaaa.tar.gz opensim-SC_OLD-3d5c389507566a632593756e015866dd80bdaaaa.tar.bz2 opensim-SC_OLD-3d5c389507566a632593756e015866dd80bdaaaa.tar.xz |
Switch to xread, remove excess error checking stuff.
Diffstat (limited to 'handlekeys.c')
-rw-r--r-- | handlekeys.c | 11 |
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; |