summaryrefslogtreecommitdiffstats
path: root/usr.sbin/moused
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>1997-01-20 08:09:20 +0000
committersos <sos@FreeBSD.org>1997-01-20 08:09:20 +0000
commitce1db87b0f7bef350a7060a71048ef9d31bba618 (patch)
treec5e00dfe294135a6056c98ebf8f8729c6e96801e /usr.sbin/moused
parentae61bb8f65594aa973c2515e7155eb97747355da (diff)
downloadFreeBSD-src-ce1db87b0f7bef350a7060a71048ef9d31bba618.zip
FreeBSD-src-ce1db87b0f7bef350a7060a71048ef9d31bba618.tar.gz
Modified moused to use select rather than read. This fixes using
the PS/2 mouse (psm device). Submitted by: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
Diffstat (limited to 'usr.sbin/moused')
-rw-r--r--usr.sbin/moused/moused.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr.sbin/moused/moused.c b/usr.sbin/moused/moused.c
index 8fbc7fc..ad4c2b1 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 */
{
OpenPOWER on IntegriCloud