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>
This commit is contained in:
parent
dc31ce3ddb
commit
20a2630b11
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=21885
@ -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 */
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user