summaryrefslogtreecommitdiff
path: root/comms/pilot-link/patches
diff options
context:
space:
mode:
authordillo <dillo@pkgsrc.org>2001-08-09 08:49:46 +0000
committerdillo <dillo@pkgsrc.org>2001-08-09 08:49:46 +0000
commit8099f4b4eff7c43a2bacf86188ca8417cddf5e8c (patch)
tree1ffd6190b3130b9cf23a3a00d6369ec9c756e63d /comms/pilot-link/patches
parent14c535f71464b13592c72cfb4378b7b8276c9563 (diff)
downloadpkgsrc-8099f4b4eff7c43a2bacf86188ca8417cddf5e8c.tar.gz
Add patch provided by Bernd Sieker to retry opening tty. This allows
pilot-links to work with newer Handspring devices (they have a *very* short timeout). Version of pilot-link-libs bumped to 0.9.5nb1.
Diffstat (limited to 'comms/pilot-link/patches')
-rw-r--r--comms/pilot-link/patches/patch-ad34
1 files changed, 34 insertions, 0 deletions
diff --git a/comms/pilot-link/patches/patch-ad b/comms/pilot-link/patches/patch-ad
new file mode 100644
index 00000000000..6516ba43e8e
--- /dev/null
+++ b/comms/pilot-link/patches/patch-ad
@@ -0,0 +1,34 @@
+$NetBSD: patch-ad,v 1.1 2001/08/09 08:49:47 dillo Exp $
+
+--- libsock/unixserial.c.orig Mon Aug 6 11:39:00 2001
++++ libsock/unixserial.c Mon Aug 6 11:42:01 2001
+@@ -156,6 +156,13 @@
+
+ int i;
+
++ /* Here we need a workaround for NetBSD USB device used with newer
++ Handspring devices (namely Platinum, Prism and Edge) */
++
++#define maxretries 100
++ int retries;
++ int rc;
++
+ #ifndef SGTTY
+ struct termios tcn;
+ #else
+@@ -166,6 +173,15 @@
+ tty = getenv("PILOTPORT");
+ if (!tty)
+ tty = "<Null>";
++
++ for (retries = 0 ; retries <= maxretries ; retries++ ) {
++ if ((rc = open(tty, O_RDWR | O_NONBLOCK)) == -1) {
++ usleep(50000);
++ } else {
++ ps->mac->fd = rc;
++ break;
++ }
++ }
+
+ if ((ps->mac->fd = open(tty, O_RDWR | O_NONBLOCK)) == -1) {
+ return -1; /* errno already set */