summaryrefslogtreecommitdiff
path: root/package/picocom/patches/patch-term_c
blob: 6ed95ab65350945803c950c751255dd9911b6aca (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
--- picocom-1.7.orig/term.c	2010-05-29 00:41:19.000000000 +0200
+++ picocom-1.7/term.c	2013-12-26 09:45:20.000000000 +0100
@@ -33,11 +33,7 @@
 #include <string.h>
 #include <errno.h>
 #include <unistd.h>
-#ifdef __linux__
-#include <termio.h>
-#else
 #include <termios.h>
-#endif /* of __linux__ */
 
 #include "term.h"
 
@@ -945,27 +941,6 @@ term_pulse_dtr (int fd)
 			break;
 		}
 
-#ifdef __linux__
-		{
-			int opins = TIOCM_DTR;
-
-			r = ioctl(fd, TIOCMBIC, &opins);
-			if ( r < 0 ) {
-				term_errno = TERM_EDTRDOWN;
-				rval = -1;
-				break;
-			}
-
-			sleep(1);
-
-			r = ioctl(fd, TIOCMBIS, &opins);
-			if ( r < 0 ) {
-				term_errno = TERM_EDTRUP;
-				rval = -1;
-				break;
-			}
-		}
-#else
 		{
 			struct termios tio, tioold;
 
@@ -997,8 +972,6 @@ term_pulse_dtr (int fd)
 				break;
 			}
 		}
-#endif /* of __linux__ */
-			
 	} while (0);
 
 	return rval;
@@ -1020,19 +993,6 @@ term_raise_dtr(int fd)
 			rval = -1;
 			break;
 		}
-
-#ifdef __linux__
-		{
-			int opins = TIOCM_DTR;
-
-			r = ioctl(fd, TIOCMBIS, &opins);
-			if ( r < 0 ) {
-				term_errno = TERM_EDTRUP;
-				rval = -1;
-				break;
-			}
-		}
-#else
 		r = tcsetattr(fd, TCSANOW, &term.currtermios[i]);
 		if ( r < 0 ) {
 			/* FIXME: perhaps try to update currtermios */
@@ -1040,7 +1000,6 @@ term_raise_dtr(int fd)
 			rval = -1;
 			break;
 		}
-#endif /* of __linux__ */
 	} while (0);
 
 	return rval;
@@ -1064,18 +1023,6 @@ term_lower_dtr(int fd)
 			break;
 		}
 
-#ifdef __linux__
-		{
-			int opins = TIOCM_DTR;
-
-			r = ioctl(fd, TIOCMBIC, &opins);
-			if ( r < 0 ) {
-				term_errno = TERM_EDTRDOWN;
-				rval = -1;
-				break;
-			}
-		}
-#else
 		{
 			struct termios tio;
 
@@ -1097,7 +1044,6 @@ term_lower_dtr(int fd)
 				break;
 			}
 		}
-#endif /* of __linux__ */
 	} while (0);
 	
 	return rval;