diff options
author | n_hibma <n_hibma@FreeBSD.org> | 1999-11-29 17:21:07 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 1999-11-29 17:21:07 +0000 |
commit | 1828a31cb5162cb3e146662bafb74907796d48f5 (patch) | |
tree | c9360fbbc34347755af8825036f303433a5c6e75 /usr.sbin/moused | |
parent | 948036bd202fe51e0517faef4034c2619bc6dfec (diff) | |
download | FreeBSD-src-1828a31cb5162cb3e146662bafb74907796d48f5.zip FreeBSD-src-1828a31cb5162cb3e146662bafb74907796d48f5.tar.gz |
Bail out on failing the read(). This happens when a USB mouse is
disconnected. We retry the open in the parent subroutine.
Remove an ifdef _i386_ . MOUSE_IF_USB is now defined for alpha as well.
Reviewed-By: yokota
Diffstat (limited to 'usr.sbin/moused')
-rw-r--r-- | usr.sbin/moused/moused.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/moused/moused.c b/usr.sbin/moused/moused.c index 1b01fde..c829275 100644 --- a/usr.sbin/moused/moused.c +++ b/usr.sbin/moused/moused.c @@ -174,9 +174,7 @@ static symtab_t rifs[] = { { "inport", MOUSE_IF_INPORT }, { "ps/2", MOUSE_IF_PS2 }, { "sysmouse", MOUSE_IF_SYSMOUSE }, -#ifdef __i386__ { "usb", MOUSE_IF_USB }, -#endif /* __i386__ */ { NULL, MOUSE_IF_UNKNOWN }, }; @@ -748,7 +746,9 @@ moused(void) } /* mouse event */ - read(rodent.mfd, &b, 1); + if (read(rodent.mfd, &b, 1) == -1); + return; /* file seems to be closed on us */ + if (r_protocol(b, &action)) { /* handler detected action */ r_map(&action, &action2); debug("activity : buttons 0x%08x dx %d dy %d dz %d", |