bump version
[buildroot.git] / package / microcom / microcom-102-002-rename-variable-log.patch
blob8516b56a418e84aec75a2defd8aa7c5dc179f66a
1 diff -rdup microcom-1.02.speed/help.c microcom-1.02/help.c
2 --- microcom-1.02.speed/help.c 2007-01-19 19:44:19.000000000 +0100
3 +++ microcom-1.02/help.c 2007-01-19 19:48:20.000000000 +0100
4 @@ -23,7 +23,7 @@ extern int crnl_mapping; //0 - no mappin
5 extern int script; /* script active flag */
6 extern char scr_name[MAX_SCRIPT_NAME]; /* default name of the script */
7 extern char device[MAX_DEVICE_NAME]; /* serial device name */
8 -extern int log; /* log active flag */
9 +extern int log_active; /* log active flag */
10 extern FILE* flog; /* log file */
12 static int help_state = 0;
13 @@ -85,7 +85,7 @@ static void help_escape(void) {
15 write(STDOUT_FILENO, str1, strlen(str1));
17 - if (log == 0)
18 + if (log_active == 0)
19 write(STDOUT_FILENO, " l - log on \n", 26);
20 else
21 write(STDOUT_FILENO, " l - log off \n", 26);
22 @@ -156,11 +156,11 @@ static void help_send_escape(int fd, cha
23 case 'q': /* quit help */
24 break;
25 case 'l': /* log on/off */
26 - log = (log == 0)? 1: 0;
27 - if (log) { /* open log file */
28 + log_active = (log_active == 0)? 1: 0;
29 + if (log_active) { /* open log file */
30 if ((flog = fopen("microcom.log", "a")) == (FILE *)0) {
31 write(STDOUT_FILENO, "Cannot open microcom.log \n", 26);
32 - log = 0;
33 + log_active = 0;
36 else { /* cloase log file */
37 diff -rdup microcom-1.02.speed/microcom.c microcom-1.02/microcom.c
38 --- microcom-1.02.speed/microcom.c 2000-08-27 17:22:47.000000000 +0200
39 +++ microcom-1.02/microcom.c 2007-01-19 19:48:37.000000000 +0100
40 @@ -25,7 +25,7 @@ int crnl_mapping; //0 - no mapping, 1 ma
41 int script = 0; /* script active flag */
42 char scr_name[MAX_SCRIPT_NAME] = "script.scr"; /* default name of the script */
43 char device[MAX_DEVICE_NAME]; /* serial device name */
44 -int log = 0; /* log active flag */
45 +int log_active = 0; /* log active flag */
46 FILE* flog; /* log file */
47 int pf = 0; /* port file descriptor */
48 struct termios pots; /* old port termios settings to restore */
49 @@ -106,7 +106,7 @@ void main_usage(int exitcode, char *str,
50 /* restore original terminal settings on exit */
51 void cleanup_termios(int signal) {
52 /* cloase the log file first */
53 - if (log) {
54 + if (log_active) {
55 fflush(flog);
56 fclose(flog);
58 diff -rdup microcom-1.02.speed/mux.c microcom-1.02/mux.c
59 --- microcom-1.02.speed/mux.c 2000-07-30 06:15:47.000000000 +0200
60 +++ microcom-1.02/mux.c 2007-01-19 19:48:48.000000000 +0100
61 @@ -24,7 +24,7 @@
63 extern int script;
64 extern char scr_name[];
65 -extern int log;
66 +extern int log_active;
67 extern FILE* flog;
69 void mux_clear_sflag(void) {
70 @@ -71,7 +71,7 @@ void mux_loop(int pf) {
71 i = read(pf, buf, BUFSIZE);
72 if (i > 0) {
73 write(STDOUT_FILENO, buf, i);
74 - if (log)
75 + if (log_active)
76 fwrite(buf, 1, i, flog);
77 if (script) {
78 i = script_process(S_DCE, buf, i);