version 1.184, 2006/06/04 16:44:08 |
version 1.185, 2006/06/07 22:33:41 |
Line 1649 ttread(struct tty *tp, struct uio *uio, |
|
Line 1649 ttread(struct tty *tp, struct uio *uio, |
|
struct proc *p; |
struct proc *p; |
int c, s, first, error, has_stime, last_cc; |
int c, s, first, error, has_stime, last_cc; |
long lflag, slp; |
long lflag, slp; |
struct timeval stime; |
struct timeval now, stime; |
|
|
stime.tv_usec = 0; /* XXX gcc */ |
stime.tv_usec = 0; /* XXX gcc */ |
stime.tv_sec = 0; /* XXX gcc */ |
stime.tv_sec = 0; /* XXX gcc */ |
Line 1723 ttread(struct tty *tp, struct uio *uio, |
|
Line 1723 ttread(struct tty *tp, struct uio *uio, |
|
if (!has_stime) { |
if (!has_stime) { |
/* first character, start timer */ |
/* first character, start timer */ |
has_stime = 1; |
has_stime = 1; |
stime = time; |
getmicrotime(&stime); |
slp = t; |
slp = t; |
} else if (qp->c_cc > last_cc) { |
} else if (qp->c_cc > last_cc) { |
/* got a character, restart timer */ |
/* got a character, restart timer */ |
stime = time; |
getmicrotime(&stime); |
slp = t; |
slp = t; |
} else { |
} else { |
/* nothing, check expiration */ |
/* nothing, check expiration */ |
slp = t - diff(time, stime); |
getmicrotime(&now); |
|
slp = t - diff(now, stime); |
} |
} |
} else { /* m == 0 */ |
} else { /* m == 0 */ |
if (qp->c_cc > 0) |
if (qp->c_cc > 0) |
goto read; |
goto read; |
if (!has_stime) { |
if (!has_stime) { |
has_stime = 1; |
has_stime = 1; |
stime = time; |
getmicrotime(&stime); |
slp = t; |
slp = t; |
} else |
} else { |
slp = t - diff(time, stime); |
getmicrotime(&now); |
|
slp = t - diff(now, stime); |
|
} |
} |
} |
last_cc = qp->c_cc; |
last_cc = qp->c_cc; |
#undef diff |
#undef diff |