summaryrefslogtreecommitdiff
path: root/graphics/irit/files/patch-irit-irit.c
blob: 0d8aa606d5e4cb0d172b866a59b465be66ce8bd9 (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
59
60
61
62
--- irit/irit.c~	Thu Sep 14 12:43:42 2000
+++ irit/irit.c	Wed Aug  7 08:46:04 2002
@@ -33,8 +33,12 @@
 #include "intr_gr.h"
 #endif /* DJGCC */
 #ifdef __UNIX__
+#if defined __FreeBSD__
+#include <term.h>
+#else
 #include <termio.h>
-static struct termio GlblOrigTermio;
+#endif /* __FreeBSD__ */
+static struct termios GlblOrigTermio;
 #endif /* __UNIX__ */
 
 #ifdef NO_CONCAT_STR
@@ -250,20 +254,33 @@
 
 #   ifdef __UNIX__
     {
+#if defined __FreeBSD__
+	struct termios Termio;
+#else
 	struct termio Termio;
+#endif /* __FreeBSD__ */
 
 	/* We read stdin on a char by char basis with a 0.1 second timer so  */
 	/* we could simultaneously handle other requests (for example, from  */
 	/* display devices).						     */
+#if defined __FreeBSD__
+	tcgetattr(0, &GlblOrigTermio);
+	tcgetattr(0, &Termio);
+#else
 	ioctl(0, TCGETA, &GlblOrigTermio);
 	ioctl(0, TCGETA, &Termio);
+#endif /* __FreeBSD__ */
 	Termio.c_lflag &= ~ICANON;	     /* Clear the canonical editing. */
 	Termio.c_cc[VEOF] = 0;    /* MIN = 0, no minimal length to wait for. */
 	Termio.c_cc[VEOL] = 1;    /* TIME - 1 tenth of a second as time out. */
 #       ifdef VSUSP
 	    Termio.c_cc[VSUSP] = 0;		   /* Disable ^Z suspension. */
 #       endif /* VSUSP */
+#if defined __FreeBSD__
+	tcsetattr(0, TCSANOW, &Termio);
+#else
 	ioctl(0, TCSETA, &Termio);
+#endif /* __FreeBSD__ */
     }
 #   endif /* __UNIX__ */
 
@@ -791,7 +808,11 @@
 	fclose(GlblLogFile);		      /* Close log file if was open. */
 
 #   ifdef __UNIX__    
+#if defined __FreeBSD__
+	tcsetattr(0, TCSANOW, &GlblOrigTermio);
+#else
 	ioctl(0, TCSETA, &GlblOrigTermio);
+#endif /* __FreeBSD__ */
 #   endif /* __UNIX__ */
 
 #   ifdef __WINNT__