diff src/lread.c @ 90789:c0409ee15cee

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 670-674) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 209-210) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-185
author Miles Bader <miles@gnu.org>
date Wed, 21 Mar 2007 13:33:07 +0000
parents 52a7f3f50b89 c8af69547c16
children 4ef881a120fe
line wrap: on
line diff
--- a/src/lread.c	Sun Mar 18 14:12:38 2007 +0000
+++ b/src/lread.c	Wed Mar 21 13:33:07 2007 +0000
@@ -38,6 +38,7 @@
 #include "keyboard.h"
 #include "termhooks.h"
 #include "coding.h"
+#include "blockinput.h"
 
 #ifdef lint
 #include <sys/inode.h>
@@ -461,7 +462,11 @@
 	   || EQ (readcharfun, Qget_emacs_mule_file_char))
     {
       if (load_each_byte)
-	ungetc (c, instream);
+	{
+	  BLOCK_INPUT;
+	  ungetc (c, instream);
+	  UNBLOCK_INPUT;
+	}
       else
 	unread_char = c;
     }
@@ -485,20 +490,28 @@
 {
   if (c >= 0)
     {
+      BLOCK_INPUT;
       ungetc (c, instream);
+      UNBLOCK_INPUT;
       return 0;
     }
 
+  BLOCK_INPUT;
   c = getc (instream);
+  UNBLOCK_INPUT;
+
 #ifdef EINTR
-      /* Interrupted reads have been observed while reading over the network */
-      while (c == EOF && ferror (instream) && errno == EINTR)
-	{
-	  QUIT;
-	  clearerr (instream);
-	  c = getc (instream);
-	}
+  /* Interrupted reads have been observed while reading over the network */
+  while (c == EOF && ferror (instream) && errno == EINTR)
+    {
+      QUIT;
+      clearerr (instream);
+      BLOCK_INPUT;
+      c = getc (instream);
+      UNBLOCK_INPUT;
+    }
 #endif
+
   return (c == EOF ? -1 : c);
 }
 
@@ -800,7 +813,9 @@
      ()
 {
   register Lisp_Object val;
+  BLOCK_INPUT;
   XSETINT (val, getc (instream));
+  UNBLOCK_INPUT;
   return val;
 }
 
@@ -1237,7 +1252,11 @@
 {
   FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer;
   if (stream != NULL)
-    fclose (stream);
+    {
+      BLOCK_INPUT;
+      fclose (stream);
+      UNBLOCK_INPUT;
+    }
   if (--load_in_progress < 0) load_in_progress = 0;
   return Qnil;
 }