aboutsummaryrefslogtreecommitdiffstats
path: root/devel/xxgdb/files/patch-ac
blob: bfb34fdfe095ddceb03c157d464adbc5397f7937 (plain) (blame)
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
50
51
52
53
54
55
56
57
58
--- calldbx.c.orig  Tue Jun 20 07:11:00 1995
+++ calldbx.c   Fri Nov 17 21:27:09 2000
@@ -74,8 +74,8 @@
 #include <string.h>
 #include <fcntl.h>
 #include "global.h"
-#if !(defined(OLDSUNOS) || defined(BSD))
-#include <termio.h>
+#if !(defined(OLDSUNOS) || defined(BSD)) || defined(__FreeBSD__)
+#include <termios.h>
 #else
 #include <sgtty.h>
 #endif
@@ -137,13 +137,17 @@
 
 #ifndef sco
    for (c='p'; c<'t'; c++) {
+#ifdef __FreeBSD__
+   for (i=0; i<32; i++) {
+#else
    for (i=0; i<16; i++) {
+#endif
 #else
    c = 'p';
    for (i=0; i<8; i++) {
 #endif
        pty[8] = c;
-       pty[9] = "0123456789abcdef"[i];
+       pty[9] = "0123456789abcdefghijklmnopqrstuv"[i];
        if ((master = open(pty, O_RDWR)) >= 0) 
        return (master); 
    }
@@ -246,8 +250,8 @@
 /*
  * (JBL)10MAY91 : use sgttyb if generic BSD
  */
-#if !(defined(OLDSUNOS) || defined(BSD))
-    struct termio Termio;
+#if !(defined(OLDSUNOS) || defined(BSD)) || defined(__FreeBSD__)
+    struct termios Termio;
 #else
     struct sgttyb Termio;
 #endif
@@ -355,11 +359,11 @@
    /*
     * (JBL)10MAY91 : use sgttyb if OLDSUN or generic BSD
     */ 
-#if !(defined(OLDSUNOS) || defined(BSD))
-   ioctl(slave, TCGETA, &Termio);
+#if !(defined(OLDSUNOS) || defined(BSD)) || defined(__FreeBSD__)
+   tcgetattr(slave, &Termio);
    Termio.c_lflag &= ~ECHO;    /* No echo */
    Termio.c_oflag &= ~ONLCR;   /* Do not map NL to CR-NL on output */
-   ioctl(slave, TCSETA, &Termio);
+   tcsetattr(slave, TCSANOW, &Termio);
 #else
    ioctl(slave, TIOCGETP, &Termio);
    Termio.sg_flags &= ~ECHO;   /* No echo */