Changeset 86029498 in mainline
- 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
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libc/generic/async.c
r2408969 r86029498 286 286 287 287 assert(PS_connection); 288 289 if (usecs < 0) /* TODO: let it get through the ipc_call once */ 290 return 0; 288 291 289 292 futex_down(&async_futex); … … 656 659 connection_t *conn; 657 660 661 /* TODO: Let it go through the event read at least once */ 662 if (timeout < 0) 663 return ETIMEOUT; 664 658 665 futex_down(&async_futex); 659 666 if (msg->done) { -
libc/include/sys/time.h
r2408969 r86029498 34 34 #define DST_NONE 0 35 35 36 typedef sysarg_ttime_t;37 typedef sysarg_tsuseconds_t;36 typedef long time_t; 37 typedef long suseconds_t; 38 38 39 39 struct timeval { -
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 */ -
tetris/screen.c
r2408969 r86029498 160 160 char smallscr[55]; 161 161 162 (void)snprintf(smallscr, sizeof(smallscr),162 snprintf(smallscr, sizeof(smallscr), 163 163 "the screen is too small (must be at least %dx%d)", 164 164 MINROWS, MINCOLS); … … 204 204 if (score != curscore) { 205 205 moveto(0, 0); 206 (void)printf("Score: %d", score);206 printf("Score: %d", score); 207 207 curscore = score; 208 208 } … … 252 252 *sp = so; 253 253 if (i != ccol) { 254 if (cur_so) { 255 resume_normal(); 256 cur_so = 0; 257 } 254 258 moveto(RTOD(j), CTOD(i)); 255 259 } … … 262 266 } 263 267 putstr(" "); 268 264 269 ccol = i + 1; 265 270 /* … … 282 287 } 283 288 } 284 resume_normal();285 289 if (cur_so) 290 resume_normal(); 286 291 fflush(); 287 292 }
Note:
See TracChangeset
for help on using the changeset viewer.