Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1532 → Rev 1531

/uspace/trunk/tetris/input.c
41,7 → 41,6
 
#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
 
#include <errno.h>
#include <unistd.h>
91,6 → 90,8
static ipc_call_t charcall;
int rc;
 
#define NILTZ ((struct timezone *)0)
 
/*
* Someday, select() will do this for us.
* Just in case that day is now, and no one has
97,7 → 98,7
* changed this, we use a temporary.
*/
if (tvp) {
(void) gettimeofday(&starttv, NULL);
(void) gettimeofday(&starttv, NILTZ);
endtv = *tvp;
s = &endtv;
} else
106,9 → 107,7
if (!lastchar) {
if (!getchar_inprog)
getchar_inprog = async_send_2(1,CONSOLE_GETCHAR,0,0,&charcall);
if (!s)
async_wait_for(getchar_inprog, &rc);
else if (async_wait_timeout(getchar_inprog, &rc, s->tv_usec) == ETIMEOUT) {
if (async_wait_timeout(getchar_inprog, &rc, s->tv_usec) == ETIMEOUT) {
tvp->tv_sec = 0;
tvp->tv_usec = 0;
return (0);
121,7 → 120,7
}
if (tvp) {
/* since there is input, we may not have timed out */
(void) gettimeofday(&endtv, NULL);
(void) gettimeofday(&endtv, NILTZ);
TV_SUB(&endtv, &starttv);
TV_SUB(tvp, &endtv); /* adjust *tvp by elapsed time */
}