From owner-freebsd-bugs Mon Sep 30 12:50:06 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id MAA28316 for bugs-outgoing; Mon, 30 Sep 1996 12:50:06 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id MAA28263; Mon, 30 Sep 1996 12:50:02 -0700 (PDT) Resent-Date: Mon, 30 Sep 1996 12:50:02 -0700 (PDT) Resent-Message-Id: <199609301950.MAA28263@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, nsayer@3do.com Received: from outland (outland.3do.com [208.192.70.2]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id MAA23819 for ; Mon, 30 Sep 1996 12:45:02 -0700 (PDT) Received: from badger.3do.com (badger.3do.com [198.211.30.7]) by outland (SMI-8.6/8.6.12) with SMTP id MAA14818 for ; Mon, 30 Sep 1996 12:44:21 -0700 Received: from jail.3do.com by badger.3do.com (4.1/SMI-4.1) id AA05084; Mon, 30 Sep 96 12:44:24 PDT Received: by jail.3do.com (8.7.5//ident-1.0) id MAA00535; Mon, 30 Sep 1996 12:44:23 -0700 (PDT) Message-Id: <199609301944.MAA00535@jail.3do.com> Date: Mon, 30 Sep 1996 12:44:23 -0700 (PDT) From: nsayer@quack.kfu.com Reply-To: nsayer@3do.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/1695: moused fails with PS/2 mice Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1695 >Category: bin >Synopsis: moused fails with PS/2 mouse >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Sep 30 12:50:01 PDT 1996 >Last-Modified: >Originator: Nick Sayer >Organization: Just me >Release: FreeBSD 2.2-960801-SNAP i386 >Environment: moused -p /dev/psm0 -t ps/2 >Description: moused terminates immediately, since the read from the mouse port returns with a 'resouce temporarily unavailable' error when there's nothing to get. >How-To-Repeat: Run the mouse daemon with a ps/2 mouse and leave the mouse still. moused -f -d will indicate that read is returning -1 with errno set to EAGAIN. >Fix: Either open the PS/2 port with blocking mode instead of non-blocking mode or better yet, put a select() in to make sure there's something to read: *** moused.c.orig Mon Sep 30 12:37:29 1996 --- moused.c Mon Sep 30 12:35:05 1996 *************** *** 53,58 **** --- 53,61 ---- #include #include #include + #include + #include + #include #define debug(fmt,args...) \ if (debug&&nodaemon) fprintf(stderr,"%s: " fmt "\n", progname, ##args) *************** *** 142,147 **** --- 145,151 ---- struct termios t; struct mouse_info mouse; int saved_buttons = 0; + fd_set fds; progname = argv[0]; *************** *** 236,241 **** --- 240,248 ---- 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 */ { >Audit-Trail: >Unformatted: