diff options
| -rw-r--r-- | usr.sbin/moused/moused.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/usr.sbin/moused/moused.c b/usr.sbin/moused/moused.c index 8fbc7fcd631c..ad4c2b14ecc2 100644 --- a/usr.sbin/moused/moused.c +++ b/usr.sbin/moused/moused.c @@ -53,6 +53,9 @@ #include <fcntl.h> #include <termios.h> #include <machine/console.h> +#include <sys/types.h> +#include <sys/time.h> +#include <unistd.h> #define debug(fmt,args...) \ if (debug&&nodaemon) fprintf(stderr,"%s: " fmt "\n", progname, ##args) @@ -150,6 +153,7 @@ main(int argc, char *argv[]) struct termios t; struct mouse_info mouse; int saved_buttons = 0; + fd_set fds; progname = argv[0]; @@ -243,6 +247,9 @@ main(int argc, char *argv[]) for(;;) { + FD_ZERO(&fds); + FD_SET(rodent.mfd,&fds); + select(FD_SETSIZE,&fds,NULL,&fds,NULL); i = read(rodent.mfd,&b,1); /* get a byte */ if (i != 1) /* read returned or error; goodbye */ { |
