Subversion Repositories HelenOS

Rev

Rev 4338 | Rev 4345 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4338 Rev 4343
Line 112... Line 112...
112
 
112
 
113
    if (!lastchar) {
113
    if (!lastchar) {
114
        if (!getchar_inprog) {
114
        if (!getchar_inprog) {
115
            cons_phone = get_cons_phone();
115
            cons_phone = get_cons_phone();
116
            getchar_inprog = async_send_2(cons_phone,
116
            getchar_inprog = async_send_2(cons_phone,
117
                CONSOLE_GETCHAR, 0, 0, &charcall);
117
                CONSOLE_GETKEY, 0, 0, &charcall);
118
        }
118
        }
119
        if (!s)
119
        if (!s)
120
            async_wait_for(getchar_inprog, &rc);
120
            async_wait_for(getchar_inprog, &rc);
121
        else if (async_wait_timeout(getchar_inprog, &rc, s->tv_usec) == ETIMEOUT) {
121
        else if (async_wait_timeout(getchar_inprog, &rc, s->tv_usec) == ETIMEOUT) {
122
            tvp->tv_sec = 0;
122
            tvp->tv_sec = 0;
Line 125... Line 125...
125
        }
125
        }
126
        getchar_inprog = 0;
126
        getchar_inprog = 0;
127
        if (rc) {
127
        if (rc) {
128
            stop("end of file, help");
128
            stop("end of file, help");
129
        }
129
        }
130
        lastchar = IPC_GET_ARG1(charcall);
130
        lastchar = IPC_GET_ARG4(charcall);
131
    }
131
    }
132
    if (tvp) {
132
    if (tvp) {
133
        /* since there is input, we may not have timed out */
133
        /* since there is input, we may not have timed out */
134
        (void) gettimeofday(&endtv, NULL);
134
        (void) gettimeofday(&endtv, NULL);
135
        TV_SUB(&endtv, &starttv);
135
        TV_SUB(&endtv, &starttv);