diff options
author | Robert Nagy <robert@cvs.openbsd.org> | 2007-06-17 10:07:31 +0000 |
---|---|---|
committer | Robert Nagy <robert@cvs.openbsd.org> | 2007-06-17 10:07:31 +0000 |
commit | 67f5e8a89135315427dee855af1347d2ecaff15b (patch) | |
tree | ee6bd159a902a7043a5e7758dfa707ae7e4eddca /usr.sbin | |
parent | 7624a188d3653ee18f612869c6a06efdc3eaa336 (diff) |
do not try to reopen the wsmouse device when
the calibration was not accurate enough and
keep the device open all the time since there is
no need to close and reopen it if we need to retry.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ztsscale/ztsscale.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/usr.sbin/ztsscale/ztsscale.c b/usr.sbin/ztsscale/ztsscale.c index 835a36d06b1..b2eff2e9920 100644 --- a/usr.sbin/ztsscale/ztsscale.c +++ b/usr.sbin/ztsscale/ztsscale.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ztsscale.c,v 1.13 2007/05/29 21:13:56 robert Exp $ */ +/* $OpenBSD: ztsscale.c,v 1.14 2007/06/17 10:07:30 robert Exp $ */ /* * Copyright (c) 2005 Matthieu Herrb @@ -162,7 +162,6 @@ cleanup(void) err(1, "WSMOUSEIO_SCALIBCOORDS"); close(mfd); - } /* ARGSUSED */ @@ -196,7 +195,6 @@ main(int argc, char *argv[]) err(2, "open /dev/ttyC0"); save_screen(); -again: mfd = open("/dev/wsmouse", O_RDWR); if (mfd < 0) { restore_screen(); @@ -217,6 +215,7 @@ again: err(1, "WSMOUSEIO_SCALIBCOORDS"); } +again: signal(SIGINT, sighandler); for (i = 0; i < 5; i++) { memset(mapaddr, WHITE, WIDTH*HEIGHT*sizeof(u_short)); @@ -229,13 +228,6 @@ again: wait_event(mfd, &x[i], &y[i]); } - /* Restore rawmode state */ - wmcoords.samplelen = orawmode; - if (ioctl(mfd, WSMOUSEIO_SCALIBCOORDS, &wmcoords) < 0) { - restore_screen(); - err(1, "WSMOUSEIO_SCALIBCOORDS"); - } - bzero(&ts, sizeof(ts)); /* get touch pad resolution to screen resolution ratio */ |