Commit 5edf5fe3 5edf5fe39c5b3f61cdce967a2a82b1988885599e by Alain Magloire

* mail/mailline.c: "interupt" is actually a key word

	for somce C compiler i.e. Watcomm C, rename it to "interrupted".
	* mail/util.c: The macros O_CREAT etc needs <sys/fnct.h>.
1 parent 733fb106
1 2001-07-06 Alain Magloire 1 2001-07-06 Alain Magloire
2 2
3 * mail/mailline.c: "interupt" is actually a key word
4 for somce C compiler i.e. Watcomm C, rename it to "interrupted".
5 * mail/util.c: The macros O_CREAT etc needs <sys/fnct.h>.
6
7 2001-07-06 Alain Magloire
8
3 * mail/mail.c: Be a little more verbose when mailbox_{create,open}() 9 * mail/mail.c: Be a little more verbose when mailbox_{create,open}()
4 fails at startup. 10 fails at startup.
5 * doc/Makefile.am: Add the missing *.texi in the list of EXTRA_DIST. 11 * doc/Makefile.am: Add the missing *.texi in the list of EXTRA_DIST.
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
20 static char **ml_command_completion __P((char *cmd, int start, int end)); 20 static char **ml_command_completion __P((char *cmd, int start, int end));
21 static char *ml_command_generator __P((char *text, int state)); 21 static char *ml_command_generator __P((char *text, int state));
22 22
23 static int _interrupt; 23 static volatile int _interrupted;
24 24
25 static RETSIGTYPE 25 static RETSIGTYPE
26 sig_handler (int signo) 26 sig_handler (int signo)
...@@ -30,7 +30,7 @@ sig_handler (int signo) ...@@ -30,7 +30,7 @@ sig_handler (int signo)
30 case SIGINT: 30 case SIGINT:
31 if (util_find_env ("quit")->set) 31 if (util_find_env ("quit")->set)
32 exit (0); 32 exit (0);
33 _interrupt++; 33 _interrupted++;
34 break; 34 break;
35 #if defined (SIGWINCH) 35 #if defined (SIGWINCH)
36 case SIGWINCH: 36 case SIGWINCH:
...@@ -43,14 +43,14 @@ sig_handler (int signo) ...@@ -43,14 +43,14 @@ sig_handler (int signo)
43 void 43 void
44 ml_clear_interrupt () 44 ml_clear_interrupt ()
45 { 45 {
46 _interrupt = 0; 46 _interrupted = 0;
47 } 47 }
48 48
49 int 49 int
50 ml_got_interrupt () 50 ml_got_interrupt ()
51 { 51 {
52 int rc = _interrupt; 52 int rc = _interrupted;
53 _interrupt = 0; 53 _interrupted = 0;
54 return rc; 54 return rc;
55 } 55 }
56 56
...@@ -66,7 +66,7 @@ ml_getc (FILE *stream) ...@@ -66,7 +66,7 @@ ml_getc (FILE *stream)
66 return c; 66 return c;
67 if (errno == EINTR) 67 if (errno == EINTR)
68 { 68 {
69 if (_interrupt) 69 if (_interrupted)
70 break; 70 break;
71 /* keep going if we handled the signal */ 71 /* keep going if we handled the signal */
72 } 72 }
...@@ -82,16 +82,16 @@ ml_readline_init () ...@@ -82,16 +82,16 @@ ml_readline_init ()
82 { 82 {
83 if (!interactive) 83 if (!interactive)
84 return; 84 return;
85 85
86 #ifdef WITH_READLINE 86 #ifdef WITH_READLINE
87 rl_readline_name = "mail"; 87 rl_readline_name = "mail";
88 rl_attempted_completion_function = (CPPFunction*)ml_command_completion; 88 rl_attempted_completion_function = (CPPFunction*)ml_command_completion;
89 rl_getc_function = ml_getc; 89 rl_getc_function = ml_getc;
90 #endif 90 #endif
91 signal (SIGINT, sig_handler); 91 signal (SIGINT, sig_handler);
92 #if defined(SIGWINCH) 92 #if defined(SIGWINCH)
93 signal (SIGWINCH, sig_handler); 93 signal (SIGWINCH, sig_handler);
94 #endif 94 #endif
95 } 95 }
96 96
97 #ifdef WITH_READLINE 97 #ifdef WITH_READLINE
...@@ -110,7 +110,7 @@ int ...@@ -110,7 +110,7 @@ int
110 ml_reread (char *prompt, char **text) 110 ml_reread (char *prompt, char **text)
111 { 111 {
112 char *s; 112 char *s;
113 113
114 insert_text = *text; 114 insert_text = *text;
115 rl_startup_hook = ml_insert_hook; 115 rl_startup_hook = ml_insert_hook;
116 s = readline (prompt); 116 s = readline (prompt);
...@@ -194,10 +194,10 @@ readline (const char *prompt) ...@@ -194,10 +194,10 @@ readline (const char *prompt)
194 size_t n; 194 size_t n;
195 195
196 p = fgets (p, alloclen - linelen, stdin); 196 p = fgets (p, alloclen - linelen, stdin);
197 197
198 if (p) 198 if (p)
199 n = strlen(p); 199 n = strlen(p);
200 else if (_interrupt) 200 else if (_interrupted)
201 { 201 {
202 free (line); 202 free (line);
203 return NULL; 203 return NULL;
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
22 # include <termios.h> 22 # include <termios.h>
23 #endif 23 #endif
24 #include <sys/ioctl.h> 24 #include <sys/ioctl.h>
25 #include <sys/fcntl.h>
25 26
26 typedef struct _node { 27 typedef struct _node {
27 /* for the msglist expander */ 28 /* for the msglist expander */
......