summaryrefslogtreecommitdiff
path: root/graphics/graphviz/files/patch-ac
blob: a9446867c3c6deec30afb8e190c183f269ec4a32 (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
--- cmd/lefty/os/unix/io.c.orig	Mon Mar 10 21:45:50 1997
+++ cmd/lefty/os/unix/io.c	Tue Jan 27 20:45:50 1998
@@ -10,7 +10,11 @@
 #include <fcntl.h>
 #include <signal.h>
 #include <sys/wait.h>
+#ifndef HAVE_TERMIOS
 #include <termio.h>
+#else
+#include <termios.h>
+#endif
 #include <sys/time.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -271,7 +267,11 @@
 static int findpty (int *fd) {
     char *majorp, *minorp;
     char pty[32], tty[32];
+#ifndef HAVE_TERMIOS
     struct termio tio;
+#else
+    struct termios tio;
+#endif
 
     static char ptymajor[] = "pqrs";
     static char ptyminor[] = "0123456789abcdefghijklmnopqrstuvwxyz";
@@ -286,9 +278,15 @@
             if ((fd[0] = open (pty, O_RDWR)) >= 0) {
                 sprintf (tty, "/dev/tty%c%c", *majorp, *minorp);
                 if ((fd[1] = open (tty, O_RDWR)) >= 0) {
+#ifndef HAVE_TERMIOS
                     ioctl (fd[1], TCGETA, &tio);
                     tio.c_lflag &= ~ECHO;
                     ioctl (fd[1], TCSETA, &tio);
+#else
+                    tcgetattr(fd[1], &tio);
+                    tio.c_lflag &= ~ECHO;
+                    tcsetattr(fd[1], TCSANOW, &tio);
+#endif
                     return 0;
                 }
                 close (fd[0]);