aboutsummaryrefslogtreecommitdiffstats
path: root/src/lread.c
diff options
context:
space:
mode:
authorKen Raeburn2016-10-27 00:50:07 -0400
committerKen Raeburn2017-06-21 22:34:33 -0400
commitefe200c10da02db68c6eeadc3cd82a8cc3108c96 (patch)
tree9d194249f93b74a18eef167efad5a5d9b1f06ce8 /src/lread.c
parent6af67b4a8842fd3b949fa5bfb68811f62a521ae2 (diff)
downloademacs-efe200c10da02db68c6eeadc3cd82a8cc3108c96.tar.gz
emacs-efe200c10da02db68c6eeadc3cd82a8cc3108c96.zip
Use getc_unlocked.
* configure.ac: Check for getc_unlocked. * src/charset.c (read_hex, load_charset_map_from_file): Use getc_unlocked instead of getc. (getc_unlocked) [!HAVE_GETC_UNLOCKED]: Fall back to getc. * src/lread.c (readbyte_from_file, Fget_file_char, read1, getc_unlocked): Likewise.
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lread.c b/src/lread.c
index a6d04ec5af7..b4ee3015e5d 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -72,6 +72,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
72#define file_tell ftell 72#define file_tell ftell
73#endif 73#endif
74 74
75#ifndef HAVE_GETC_UNLOCKED
76#define getc_unlocked getc
77#endif
78
75/* The association list of objects read with the #n=object form. 79/* The association list of objects read with the #n=object form.
76 Each member of the list has the form (n . object), and is used to 80 Each member of the list has the form (n . object), and is used to
77 look up the object for the corresponding #n# construct. 81 look up the object for the corresponding #n# construct.
@@ -445,7 +449,7 @@ readbyte_from_file (int c, Lisp_Object readcharfun)
445 } 449 }
446 450
447 block_input (); 451 block_input ();
448 c = getc (instream); 452 c = getc_unlocked (instream);
449 453
450 /* Interrupted reads have been observed while reading over the network. */ 454 /* Interrupted reads have been observed while reading over the network. */
451 while (c == EOF && ferror (instream) && errno == EINTR) 455 while (c == EOF && ferror (instream) && errno == EINTR)
@@ -454,7 +458,7 @@ readbyte_from_file (int c, Lisp_Object readcharfun)
454 maybe_quit (); 458 maybe_quit ();
455 block_input (); 459 block_input ();
456 clearerr (instream); 460 clearerr (instream);
457 c = getc (instream); 461 c = getc_unlocked (instream);
458 } 462 }
459 463
460 unblock_input (); 464 unblock_input ();
@@ -757,7 +761,7 @@ DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0,
757{ 761{
758 register Lisp_Object val; 762 register Lisp_Object val;
759 block_input (); 763 block_input ();
760 XSETINT (val, getc (instream)); 764 XSETINT (val, getc_unlocked (instream));
761 unblock_input (); 765 unblock_input ();
762 return val; 766 return val;
763} 767}
@@ -2901,7 +2905,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
2901 /* Copy that many characters into saved_doc_string. */ 2905 /* Copy that many characters into saved_doc_string. */
2902 block_input (); 2906 block_input ();
2903 for (i = 0; i < nskip && c >= 0; i++) 2907 for (i = 0; i < nskip && c >= 0; i++)
2904 saved_doc_string[i] = c = getc (instream); 2908 saved_doc_string[i] = c = getc_unlocked (instream);
2905 unblock_input (); 2909 unblock_input ();
2906 2910
2907 saved_doc_string_length = i; 2911 saved_doc_string_length = i;