updated on Sat Jan 21 04:00:54 UTC 2012
[aur-mirror.git] / microcom / microcom-1.02_cleanup.patch
blob47577d95f4689c2de8a38f5c4052cee2531503cb
1 --- microcom.c.orig 2007-10-04 13:06:39.000000000 +0300
2 +++ microcom.c 2007-10-04 13:06:56.000000000 +0300
3 @@ -25,7 +25,7 @@
4 int script = 0; /* script active flag */
5 char scr_name[MAX_SCRIPT_NAME] = "script.scr"; /* default name of the script */
6 char device[MAX_DEVICE_NAME]; /* serial device name */
7 -int log = 0; /* log active flag */
8 +int ilog = 0; /* log active flag */
9 FILE* flog; /* log file */
10 int pf = 0; /* port file descriptor */
11 struct termios pots; /* old port termios settings to restore */
12 @@ -106,7 +106,7 @@
13 /* restore original terminal settings on exit */
14 void cleanup_termios(int signal) {
15 /* cloase the log file first */
16 - if (log) {
17 + if (ilog) {
18 fflush(flog);
19 fclose(flog);
21 --- help.c.orig 2007-10-04 13:07:24.000000000 +0300
22 +++ help.c 2007-10-04 13:07:45.000000000 +0300
23 @@ -23,7 +23,7 @@
24 extern int script; /* script active flag */
25 extern char scr_name[MAX_SCRIPT_NAME]; /* default name of the script */
26 extern char device[MAX_DEVICE_NAME]; /* serial device name */
27 -extern int log; /* log active flag */
28 +extern int ilog; /* log active flag */
29 extern FILE* flog; /* log file */
31 static int help_state = 0;
32 @@ -85,7 +85,7 @@
34 write(STDOUT_FILENO, str1, strlen(str1));
36 - if (log == 0)
37 + if (ilog == 0)
38 write(STDOUT_FILENO, " l - log on \n", 26);
39 else
40 write(STDOUT_FILENO, " l - log off \n", 26);
41 @@ -156,11 +156,11 @@
42 case 'q': /* quit help */
43 break;
44 case 'l': /* log on/off */
45 - log = (log == 0)? 1: 0;
46 - if (log) { /* open log file */
47 + ilog = (ilog == 0)? 1: 0;
48 + if (ilog) { /* open log file */
49 if ((flog = fopen("microcom.log", "a")) == (FILE *)0) {
50 write(STDOUT_FILENO, "Cannot open microcom.log \n", 26);
51 - log = 0;
52 + ilog = 0;
55 else { /* cloase log file */
56 --- mux.c.orig 2007-10-04 13:07:04.000000000 +0300
57 +++ mux.c 2007-10-04 13:07:14.000000000 +0300
58 @@ -24,7 +24,7 @@
60 extern int script;
61 extern char scr_name[];
62 -extern int log;
63 +extern int ilog;
64 extern FILE* flog;
66 void mux_clear_sflag(void) {
67 @@ -71,7 +71,7 @@
68 i = read(pf, buf, BUFSIZE);
69 if (i > 0) {
70 write(STDOUT_FILENO, buf, i);
71 - if (log)
72 + if (ilog)
73 fwrite(buf, 1, i, flog);
74 if (script) {
75 i = script_process(S_DCE, buf, i);