File: option-to-not-force-hw-control.patch

package info (click to toggle)
uucp 1.07-31
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,180 kB
  • sloc: ansic: 53,821; sh: 4,477; makefile: 202; perl: 199
file content (322 lines) | stat: -rw-r--r-- 10,715 bytes parent folder | download | duplicates (2)
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
Description: avoid forcing hw control
Author: Michal Suchanek
Forwarded: not-needed
Index: uucp-1.07/conn.h
===================================================================
--- uucp-1.07.orig/conn.h	2013-12-04 11:20:23.722208868 +0100
+++ uucp-1.07/conn.h	2013-12-04 11:20:26.022181350 +0100
@@ -117,7 +117,7 @@
   boolean (*pfunlock) P((struct sconnection *qconn));
   /* Open the connection.  */
   boolean (*pfopen) P((struct sconnection *qconn, long ibaud,
-		       boolean fwait, boolean fuser));
+		       boolean fwait, boolean fuser, boolean nortscts));
   /* Close the connection.  */
   boolean (*pfclose) P((struct sconnection *qconn,
 			pointer puuconf,
@@ -198,7 +198,7 @@
    than the effective permissions.  */
 extern boolean fconn_open P((struct sconnection *qconn, long ibaud,
 			     long ihighbaud, boolean fwait,
-			     boolean fuser));
+			     boolean fuser, boolean nortscts));
 
 /* Close a connection.  The fsuccess argument is TRUE if the
    conversation completed normally, FALSE if it is being aborted.  */
Index: uucp-1.07/cu.c
===================================================================
--- uucp-1.07.orig/cu.c	2013-12-04 11:20:23.722208868 +0100
+++ uucp-1.07/cu.c	2013-12-04 11:27:03.353425764 +0100
@@ -223,6 +223,7 @@
   { "baud", required_argument, NULL, 's' },
   { "mapcr", no_argument, NULL, 't' },
   { "nostop", no_argument, NULL, 3 },
+  { "nortscts", no_argument, NULL, 'f' },
   { "system", required_argument, NULL, 'z' },
   { "config", required_argument, NULL, 'I' },
   { "debug", required_argument, NULL, 'x' },
@@ -258,6 +259,8 @@
   enum txonxoffsetting txonxoff = XONXOFF_ON;
   /* -I: configuration file name.  */
   const char *zconfig = NULL;
+  /* -f: no hardware flow control */
+  boolean nortscts = FALSE;
   int iopt;
   pointer puuconf;
   int iuuconf;
@@ -295,7 +298,7 @@
 	}
     }
 
-  while ((iopt = getopt_long (argc, argv, "a:c:deE:hnI:l:op:s:tvx:z:",
+  while ((iopt = getopt_long (argc, argv, "a:c:deE:fhnI:l:op:s:tvx:z:",
 			      asCulongopts, (int *) NULL)) != EOF)
     {
       switch (iopt)
@@ -322,6 +325,11 @@
 	  zCuvar_escape = optarg;
 	  break;
 
+	case 'f':
+	  /* No hardware flow control.  */
+	  nortscts = TRUE;
+	  break;
+
 	case 'h':
 	  /* Local echo.  */
 	  fCulocalecho = TRUE;
@@ -682,7 +690,7 @@
 	}
 
       /* Here we have locked a connection to use.  */
-      if (! fconn_open (&sconn, iusebaud, ihighbaud, FALSE, sinfo.fdirect))
+      if (! fconn_open (&sconn, iusebaud, ihighbaud, FALSE, sinfo.fdirect, nortscts))
 	ucuabort ();
 
       fCuclose_conn = TRUE;
Index: uucp-1.07/conn.c
===================================================================
--- uucp-1.07.orig/conn.c	2013-12-04 11:20:23.722208868 +0100
+++ uucp-1.07/conn.c	2013-12-04 11:20:26.026181299 +0100
@@ -114,12 +114,13 @@
 /* Open a connection.  */
 
 boolean
-fconn_open (qconn, ibaud, ihighbaud, fwait, fuser)
+fconn_open (qconn, ibaud, ihighbaud, fwait, fuser, nortscts)
      struct sconnection *qconn;
      long ibaud;
      long ihighbaud;
      boolean fwait;
      boolean fuser;
+     boolean nortscts;
 {
   boolean fret;
 
@@ -177,7 +178,7 @@
   else
     ulog_device (qconn->qport->uuconf_zname);
 
-  fret = (*qconn->qcmds->pfopen) (qconn, ibaud, fwait, fuser);
+  fret = (*qconn->qcmds->pfopen) (qconn, ibaud, fwait, fuser, nortscts);
 
   if (! fret)
     ulog_device ((const char *) NULL);
Index: uucp-1.07/uucico.c
===================================================================
--- uucp-1.07.orig/uucico.c	2013-12-04 11:20:23.722208868 +0100
+++ uucp-1.07/uucico.c	2013-12-04 11:20:26.026181299 +0100
@@ -695,7 +695,7 @@
 
       if (fret)
 	{
-	  if (! fconn_open (&sconn, (long) 0, (long) 0, TRUE, FALSE))
+	  if (! fconn_open (&sconn, (long) 0, (long) 0, TRUE, FALSE, FALSE))
 	    fret = FALSE;
 	  qConn = &sconn;
 	}
@@ -714,7 +714,7 @@
 				     (struct uuconf_dialer *) NULL,
 				     TRUE)
 		      || ! fconn_open (&sconn, (long) 0, (long) 0, TRUE,
-				       FALSE))
+				       FALSE, FALSE))
 		    break;
 		}
 	      fret = FALSE;
@@ -1176,7 +1176,7 @@
     }
 
   if (! fconn_open (&sconn, qsys->uuconf_ibaud, qsys->uuconf_ihighbaud,
-		    FALSE, FALSE))
+		    FALSE, FALSE, FALSE))
     {
       terr = STATUS_PORT_FAILED;
       fret = FALSE;
Index: uucp-1.07/unix/pipe.c
===================================================================
--- uucp-1.07.orig/unix/pipe.c	2013-12-04 11:20:23.722208868 +0100
+++ uucp-1.07/unix/pipe.c	2013-12-04 11:20:26.026181299 +0100
@@ -49,7 +49,7 @@
 
 static void uspipe_free P((struct sconnection *qconn));
 static boolean fspipe_open P((struct sconnection *qconn, long ibaud,
-			      boolean fwait, boolean fuser));
+			      boolean fwait, boolean fuser, boolean nortscts));
 static boolean fspipe_close P((struct sconnection *qconn,
 			       pointer puuconf,
 			       struct uuconf_dialer *qdialer,
@@ -115,11 +115,12 @@
 
 /*ARGSUSED*/
 static boolean
-fspipe_open (qconn, ibaud, fwait, fuser)
+fspipe_open (qconn, ibaud, fwait, fuser, nortscts)
      struct sconnection *qconn ATTRIBUTE_UNUSED;
      long ibaud ATTRIBUTE_UNUSED;
      boolean fwait;
      boolean fuser ATTRIBUTE_UNUSED;
+     boolean nortscts ATTRIBUTE_UNUSED;
 {
   /* We don't do incoming waits on pipes.  */
   if (fwait)
Index: uucp-1.07/unix/serial.c
===================================================================
--- uucp-1.07.orig/unix/serial.c	2013-12-04 11:20:23.722208868 +0100
+++ uucp-1.07/unix/serial.c	2013-12-04 11:20:26.026181299 +0100
@@ -246,11 +246,11 @@
 				boolean fwait, boolean fuser,
 				enum tclocal_setting tlocal));
 static boolean fsstdin_open P((struct sconnection *qconn, long ibaud,
-			       boolean fwait, boolean fuser));
+			       boolean fwait, boolean fuser, boolean nortscts));
 static boolean fsmodem_open P((struct sconnection *qconn, long ibaud,
-			       boolean fwait, boolean fuser));
+			       boolean fwait, boolean fuser, boolean nortscts));
 static boolean fsdirect_open P((struct sconnection *qconn, long ibaud,
-				boolean fwait, boolean fuser));
+				boolean fwait, boolean fuser, boolean nortscts));
 static boolean fsblock P((struct ssysdep_conn *q, boolean fblock));
 static boolean fsserial_close P((struct ssysdep_conn *q));
 static boolean fsstdin_close P((struct sconnection *qconn,
@@ -1308,11 +1308,12 @@
    call to fsblock.  */
 
 static boolean
-fsstdin_open (qconn, ibaud, fwait, fuser)
+fsstdin_open (qconn, ibaud, fwait, fuser, nortscts)
      struct sconnection *qconn;
      long ibaud;
      boolean fwait;
      boolean fuser;
+     boolean nortscts;
 {
   struct ssysdep_conn *q;
 
@@ -1323,6 +1324,9 @@
   q->o = q->ord;
   if (! fsserial_open (qconn, ibaud, fwait, fuser, IGNORE_CLOCAL))
     return FALSE;
+  if (nortscts
+      && ! fsserial_hardflow (qconn, FALSE))
+    return FALSE;
   q->iwr_flags = fcntl (q->owr, F_GETFL, 0);
   if (q->iwr_flags < 0)
     {
@@ -1335,11 +1339,12 @@
 /* Open a modem port.  */
 
 static boolean
-fsmodem_open (qconn, ibaud, fwait, fuser)
+fsmodem_open (qconn, ibaud, fwait, fuser, nortscts)
      struct sconnection *qconn;
      long ibaud;
      boolean fwait;
      boolean fuser;
+     boolean nortscts;
 {
   struct uuconf_modem_port *qm;
 
@@ -1356,7 +1361,10 @@
      out, because some modems don't assert the necessary signals until
      they see carrier.  Instead, we turn on hardware flow control in
      fsmodem_carrier.  */
-  if (fwait
+  if (nortscts
+      && ! fsserial_hardflow (qconn, FALSE))
+    return FALSE;
+  else if (fwait
       && ! fsserial_hardflow (qconn, qm->uuconf_fhardflow))
     return FALSE;
 
@@ -1366,11 +1374,12 @@
 /* Open a direct port.  */
 
 static boolean
-fsdirect_open (qconn, ibaud, fwait, fuser)
+fsdirect_open (qconn, ibaud, fwait, fuser, nortscts)
      struct sconnection *qconn;
      long ibaud;
      boolean fwait;
      boolean fuser;
+     boolean nortscts;
 {
   struct uuconf_direct_port *qd;
 
@@ -1383,7 +1392,7 @@
 
   /* Always turn on hardware flow control for a direct port when it is
      opened.  There is no other sensible time to turn it on.  */
-  return fsserial_hardflow (qconn, qd->uuconf_fhardflow);
+  return fsserial_hardflow (qconn, qd->uuconf_fhardflow && ! nortscts);
 }
 
 /* Change the blocking status of the port.  We keep track of the
Index: uucp-1.07/unix/tcp.c
===================================================================
--- uucp-1.07.orig/unix/tcp.c	2013-12-04 11:20:23.722208868 +0100
+++ uucp-1.07/unix/tcp.c	2013-12-04 11:20:26.026181299 +0100
@@ -78,7 +78,7 @@
 #endif
 static boolean ftcp_set_flags P((struct ssysdep_conn *qsysdep));
 static boolean ftcp_open P((struct sconnection *qconn, long ibaud,
-			    boolean fwait, boolean fuser));
+			    boolean fwait, boolean fuser, boolean nortscts));
 static boolean ftcp_close P((struct sconnection *qconn,
 			     pointer puuconf,
 			     struct uuconf_dialer *qdialer,
@@ -208,11 +208,12 @@
    system.  */
 
 static boolean
-ftcp_open (qconn, ibaud, fwait, fuser)
+ftcp_open (qconn, ibaud, fwait, fuser, nortscts)
      struct sconnection *qconn;
      long ibaud ATTRIBUTE_UNUSED;
      boolean fwait;
      boolean fuser ATTRIBUTE_UNUSED;
+     boolean nortscts ATTRIBUTE_UNUSED;
 {
   struct ssysdep_conn *qsysdep;
   const char *zport;
Index: uucp-1.07/unix/tli.c
===================================================================
--- uucp-1.07.orig/unix/tli.c	2013-12-04 11:20:23.722208868 +0100
+++ uucp-1.07/unix/tli.c	2013-12-04 11:20:26.026181299 +0100
@@ -106,7 +106,7 @@
 static void utli_free P((struct sconnection *qconn));
 static boolean ftli_push P((struct sconnection *qconn));
 static boolean ftli_open P((struct sconnection *qconn, long ibaud,
-			    boolean fwait, boolean fuser));
+			    boolean fwait, boolean fuser, boolean nortscts));
 static boolean ftli_close P((struct sconnection *qconn,
 			     pointer puuconf,
 			     struct uuconf_dialer *qdialer,
@@ -238,11 +238,12 @@
    system.  */
 
 static boolean
-ftli_open (qconn, ibaud, fwait, fuser)
+ftli_open (qconn, ibaud, fwait, fuser, nortscts)
      struct sconnection *qconn;
      long ibaud;
      boolean fwait;
      boolean fuser ATTRIBUTE_UNUSED;
+     boolean nortscts ATTRIBUTE_UNUSED;
 {
   struct ssysdep_conn *qsysdep;
   const char *zdevice;
Index: uucp-1.07/cu.1
===================================================================
--- uucp-1.07.orig/cu.1	2013-12-04 11:20:23.722208868 +0100
+++ uucp-1.07/cu.1	2013-12-04 11:20:26.026181299 +0100
@@ -231,6 +231,9 @@
 .B \-\-nostop
 Turn off XON/XOFF handling (it is on by default).
 .TP 5
+.B \-f, \-\-nortscts
+Do not use hardware flow control.
+.TP 5
 .B \-E char, \-\-escape char
 Set the escape character.  Initially
 .B ~