Changeset 86029498 in mainline for tetris/input.c


Ignore:
Timestamp:
2006-06-02T21:53:26Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
59ed572
Parents:
2408969
Message:

Small changes to tetris.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tetris/input.c

    r2408969 r86029498  
    4242#include <sys/types.h>
    4343#include <sys/time.h>
     44#include <stdio.h>
    4445
    4546#include <errno.h>
     
    9192        int rc;
    9293
    93 #define NILTZ ((struct timezone *)0)
    94 
    9594        /*
    9695         * Someday, select() will do this for us.
     
    9998         */
    10099        if (tvp) {
    101                 (void) gettimeofday(&starttv, NILTZ);
     100                (void) gettimeofday(&starttv, NULL);
    102101                endtv = *tvp;
    103102                s = &endtv;
     
    108107                if (!getchar_inprog)
    109108                        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) {
    111112                        tvp->tv_sec = 0;
    112113                        tvp->tv_usec = 0;
     
    121122        if (tvp) {
    122123                /* since there is input, we may not have timed out */
    123                 (void) gettimeofday(&endtv, NILTZ);
     124                (void) gettimeofday(&endtv, NULL);
    124125                TV_SUB(&endtv, &starttv);
    125126                TV_SUB(tvp, &endtv);    /* adjust *tvp by elapsed time */
Note: See TracChangeset for help on using the changeset viewer.