-/* $NetBSD: input.c,v 1.8 2002/12/29 15:12:17 kristerw Exp $ */
+/* $NetBSD: input.c,v 1.11 2009/05/25 04:33:53 dholland Exp $ */
/*-
* Copyright (c) 1992, 1993
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* Return 0 => no input, 1 => can read() from stdin
*/
int
-rwait(tvp)
- struct timeval *tvp;
+rwait(struct timeval *tvp)
{
struct pollfd set[1];
struct timeval starttv, endtv;
/* NOTREACHED */
case 0: /* timed out */
- tvp->tv_sec = 0;
- tvp->tv_usec = 0;
+ if (tvp) {
+ tvp->tv_sec = 0;
+ tvp->tv_usec = 0;
+ }
return (0);
}
if (tvp) {
* Eat any input that might be available.
*/
void
-tsleep()
+tsleep(void)
{
struct timeval tv;
char c;
* getchar with timeout.
*/
int
-tgetchar()
+tgetchar(void)
{
static struct timeval timeleft;
char c;