aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/moused/moused.c
diff options
context:
space:
mode:
authorKazutaka YOKOTA <yokota@FreeBSD.org>1998-11-20 11:17:59 +0000
committerKazutaka YOKOTA <yokota@FreeBSD.org>1998-11-20 11:17:59 +0000
commitc49f79b7e2a367cfa6b30f18e4198477a45e0057 (patch)
tree16ccda25d003d3c4f7a7b3f42c8e69e3e6cda52e /usr.sbin/moused/moused.c
parent6ab6e1696261d255d7e31ae00847dc9b4a922de6 (diff)
downloadsrc-c49f79b7e2a367cfa6b30f18e4198477a45e0057.tar.gz
src-c49f79b7e2a367cfa6b30f18e4198477a45e0057.zip
- Reorganized a `if-else' close a bit for clarity. Purely cosmetic
change. No functional difference.
Notes
Notes: svn path=/head/; revision=41269
Diffstat (limited to 'usr.sbin/moused/moused.c')
-rw-r--r--usr.sbin/moused/moused.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/usr.sbin/moused/moused.c b/usr.sbin/moused/moused.c
index 2717fc00971e..c56855ab152f 100644
--- a/usr.sbin/moused/moused.c
+++ b/usr.sbin/moused/moused.c
@@ -1870,7 +1870,7 @@ pnpwakeup1(void)
* The PnP COM device spec. dictates that the mouse must set DSR
* in response to DTR (by hardware or by software) and that if DSR is
* not asserted, the host computer should think that there is no device
- * at this serial port. But there are some mice just don't do that...
+ * at this serial port. But some mice just don't do that...
*/
ioctl(rodent.mfd, TIOCMGET, &i);
debug("modem status 0%o", i);
@@ -1900,29 +1900,29 @@ pnpwakeup1(void)
if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) > 0) {
debug("pnpwakeup1(): valid response in first phase.");
return TRUE;
- } else {
+ }
- /* port setup, 2nd phase (2.1.5) */
- i = TIOCM_DTR | TIOCM_RTS; /* DTR = 0, RTS = 0 */
- ioctl(rodent.mfd, TIOCMBIC, &i);
- usleep(240000);
+ /* port setup, 2nd phase (2.1.5) */
+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 0, RTS = 0 */
+ ioctl(rodent.mfd, TIOCMBIC, &i);
+ usleep(240000);
- /* wait for respose, 2nd phase (2.1.6) */
- i = FREAD;
- ioctl(rodent.mfd, TIOCFLUSH, &i);
- i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */
- ioctl(rodent.mfd, TIOCMBIS, &i);
+ /* wait for respose, 2nd phase (2.1.6) */
+ i = FREAD;
+ ioctl(rodent.mfd, TIOCFLUSH, &i);
+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */
+ ioctl(rodent.mfd, TIOCMBIS, &i);
- /* try to read something */
- FD_ZERO(&fds);
- FD_SET(rodent.mfd, &fds);
- timeout.tv_sec = 0;
- timeout.tv_usec = 240000;
- if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) > 0) {
- debug("pnpwakeup1(): valid response in second phase.");
- return TRUE;
- }
+ /* try to read something */
+ FD_ZERO(&fds);
+ FD_SET(rodent.mfd, &fds);
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 240000;
+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) > 0) {
+ debug("pnpwakeup1(): valid response in second phase.");
+ return TRUE;
}
+
return FALSE;
}
@@ -1936,7 +1936,7 @@ pnpwakeup2(void)
/*
* This is a simplified procedure; it simply toggles RTS.
*/
- debug("PnP COM device rev 0.9 probe...");
+ debug("alternate probe...");
ioctl(rodent.mfd, TIOCMGET, &i);
i |= TIOCM_DTR; /* DTR = 1 */
@@ -1961,6 +1961,7 @@ pnpwakeup2(void)
debug("pnpwakeup2(): valid response.");
return TRUE;
}
+
return FALSE;
}