summaryrefslogtreecommitdiff
path: root/comms/modemd/patches/patch-ab
blob: 297bd77916148adae2d2bd24f21debd62bc9b4a1 (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
$NetBSD: patch-ab,v 1.3 2007/10/10 16:53:58 rillig Exp $

--- common/ttio.c.orig	1997-02-21 23:06:09.000000000 +0000
+++ common/ttio.c	2007-10-10 16:48:38.000000000 +0000
@@ -51,6 +51,7 @@ static char copyright[] =
 #include "mcap.h"
 #include "ttio.h"
 #include <pwd.h>
+#include <stdlib.h>
 
 static void dectl PROTO ((char *, int, char *, int, char *));
 
@@ -73,6 +74,16 @@ int ttsetup (name)
     {
       if (chown (nbuf, pw -> pw_uid, pw -> pw_gid) < 0)
 	warn ("Can't set owner on %s: %m", nbuf);
+#ifdef __NetBSD__
+      if (chmod (nbuf, 0600) < 0)
+        warn ("Can't set mode on %s: %m", nbuf);
+      revoke(nbuf);
+      if (ttyaction(nbuf, "modemd", "root"))
+        warn ("Can't ttyaction %s: %m", nbuf);
+
+      /* delay open so DTR stays down long enough to be detected */
+      usleep(100);
+#endif
     }
 
   /* Open the terminal device. */