summaryrefslogtreecommitdiff
path: root/graphics/opendis/patches/patch-aa
blob: 4ece25f4d623a9f004b93181e4bd4b1783f089a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
$NetBSD: patch-aa,v 1.1.1.1 2000/05/12 03:07:40 sommerfeld Exp $

--- src/nss.c.orig	Sat Jan  8 16:09:52 2000
+++ src/nss.c	Thu May 11 22:58:35 2000
@@ -37,6 +37,10 @@
 #include <stdlib.h>
 #include <termios.h>
 
+#ifdef __NetBSD__
+#include <sys/ioctl.h>
+#endif
+
 /*--------------------------------------------------------------------------
   Local include files */
 
@@ -110,6 +114,9 @@
 
   /* Put it in raw mode */
   memset(&tty, 0, sizeof(tty));
+#ifdef __NetBSD__
+  memcpy(&tty, &camera->tty_original, sizeof(tty));
+#endif
   cfmakeraw(&tty);
 
   /* A respondent reports that his camera won't begin talking until
@@ -135,8 +142,12 @@
      will initiate beacon phase from the camera. */
 
   /* off... */
+#ifdef __NetBSD__
+  (void) ioctl(camera->fd, TIOCCDTR, 0);
+#else  
   cfsetospeed(&tty, B0);
   cfsetispeed(&tty, B0);
+#endif
 
   if (tcsetattr(camera->fd, TCSANOW, &tty) == -1)
     {
@@ -157,6 +168,10 @@
   /* ...on. */
   cfsetospeed(&tty, B9600);
   cfsetispeed(&tty, B9600);
+
+#ifdef __NetBSD__
+  (void) ioctl(camera->fd, TIOCSDTR, 0);
+#endif
 
   if (tcsetattr(camera->fd, TCSANOW, &tty) == -1)
     {