Changeset 86029498 in mainline for tetris/input.c
- Timestamp:
- 2006-06-02T21:53:26Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 59ed572
- Parents:
- 2408969
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tetris/input.c
r2408969 r86029498 42 42 #include <sys/types.h> 43 43 #include <sys/time.h> 44 #include <stdio.h> 44 45 45 46 #include <errno.h> … … 91 92 int rc; 92 93 93 #define NILTZ ((struct timezone *)0)94 95 94 /* 96 95 * Someday, select() will do this for us. … … 99 98 */ 100 99 if (tvp) { 101 (void) gettimeofday(&starttv, N ILTZ);100 (void) gettimeofday(&starttv, NULL); 102 101 endtv = *tvp; 103 102 s = &endtv; … … 108 107 if (!getchar_inprog) 109 108 getchar_inprog = async_send_2(1,CONSOLE_GETCHAR,0,0,&charcall); 110 if (async_wait_timeout(getchar_inprog, &rc, s->tv_usec) == ETIMEOUT) { 109 if (!s) 110 async_wait_for(getchar_inprog, &rc); 111 else if (async_wait_timeout(getchar_inprog, &rc, s->tv_usec) == ETIMEOUT) { 111 112 tvp->tv_sec = 0; 112 113 tvp->tv_usec = 0; … … 121 122 if (tvp) { 122 123 /* since there is input, we may not have timed out */ 123 (void) gettimeofday(&endtv, N ILTZ);124 (void) gettimeofday(&endtv, NULL); 124 125 TV_SUB(&endtv, &starttv); 125 126 TV_SUB(tvp, &endtv); /* adjust *tvp by elapsed time */
Note:
See TracChangeset
for help on using the changeset viewer.