aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2007-03-20 08:50:31 +0000
committerYAMAMOTO Mitsuharu2007-03-20 08:50:31 +0000
commit66cd0949c99ad185fc1ecf4c0e206a695bd19020 (patch)
treec0fcaaaab1c846ed37e06004ae075e32fa4f9d56 /src
parent34f5c10fbce94075bfbbfa904c9cc1d595893ad8 (diff)
downloademacs-66cd0949c99ad185fc1ecf4c0e206a695bd19020.tar.gz
emacs-66cd0949c99ad185fc1ecf4c0e206a695bd19020.zip
Include blockinput.h.
(readchar, Fget_file_char): Add BLOCK_INPUT around getc. (unreadchar): Add BLOCK_INPUT around ungetc. (load_unwind): Add BLOCK_INPUT around fclose.
Diffstat (limited to 'src')
-rw-r--r--src/lread.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/lread.c b/src/lread.c
index 8fc1335698f..30aab7cce32 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -36,6 +36,7 @@ Boston, MA 02110-1301, USA. */
36#include "keyboard.h" 36#include "keyboard.h"
37#include "termhooks.h" 37#include "termhooks.h"
38#include "coding.h" 38#include "coding.h"
39#include "blockinput.h"
39 40
40#ifdef lint 41#ifdef lint
41#include <sys/inode.h> 42#include <sys/inode.h>
@@ -324,14 +325,18 @@ readchar (readcharfun)
324 325
325 if (EQ (readcharfun, Qget_file_char)) 326 if (EQ (readcharfun, Qget_file_char))
326 { 327 {
328 BLOCK_INPUT;
327 c = getc (instream); 329 c = getc (instream);
330 UNBLOCK_INPUT;
328#ifdef EINTR 331#ifdef EINTR
329 /* Interrupted reads have been observed while reading over the network */ 332 /* Interrupted reads have been observed while reading over the network */
330 while (c == EOF && ferror (instream) && errno == EINTR) 333 while (c == EOF && ferror (instream) && errno == EINTR)
331 { 334 {
332 QUIT; 335 QUIT;
333 clearerr (instream); 336 clearerr (instream);
337 BLOCK_INPUT;
334 c = getc (instream); 338 c = getc (instream);
339 UNBLOCK_INPUT;
335 } 340 }
336#endif 341#endif
337 return c; 342 return c;
@@ -414,7 +419,11 @@ unreadchar (readcharfun, c)
414 else if (EQ (readcharfun, Qlambda)) 419 else if (EQ (readcharfun, Qlambda))
415 read_bytecode_char (1); 420 read_bytecode_char (1);
416 else if (EQ (readcharfun, Qget_file_char)) 421 else if (EQ (readcharfun, Qget_file_char))
417 ungetc (c, instream); 422 {
423 BLOCK_INPUT;
424 ungetc (c, instream);
425 UNBLOCK_INPUT;
426 }
418 else 427 else
419 call1 (readcharfun, make_number (c)); 428 call1 (readcharfun, make_number (c));
420} 429}
@@ -625,7 +634,9 @@ DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0,
625 () 634 ()
626{ 635{
627 register Lisp_Object val; 636 register Lisp_Object val;
637 BLOCK_INPUT;
628 XSETINT (val, getc (instream)); 638 XSETINT (val, getc (instream));
639 UNBLOCK_INPUT;
629 return val; 640 return val;
630} 641}
631 642
@@ -1044,7 +1055,11 @@ load_unwind (arg) /* used as unwind-protect function in load */
1044{ 1055{
1045 FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer; 1056 FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer;
1046 if (stream != NULL) 1057 if (stream != NULL)
1047 fclose (stream); 1058 {
1059 BLOCK_INPUT;
1060 fclose (stream);
1061 UNBLOCK_INPUT;
1062 }
1048 if (--load_in_progress < 0) load_in_progress = 0; 1063 if (--load_in_progress < 0) load_in_progress = 0;
1049 return Qnil; 1064 return Qnil;
1050} 1065}