aboutsummaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 08be41f9fe4..e335dcf027f 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3187,6 +3187,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
3187 Lisp_Object p; 3187 Lisp_Object p;
3188 EMACS_INT total = 0; 3188 EMACS_INT total = 0;
3189 int not_regular = 0; 3189 int not_regular = 0;
3190 int save_errno = 0;
3190 char read_buf[READ_BUF_SIZE]; 3191 char read_buf[READ_BUF_SIZE];
3191 struct coding_system coding; 3192 struct coding_system coding;
3192 char buffer[1 << 14]; 3193 char buffer[1 << 14];
@@ -3250,6 +3251,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
3250#endif /* WINDOWSNT */ 3251#endif /* WINDOWSNT */
3251 { 3252 {
3252 badopen: 3253 badopen:
3254 save_errno = errno;
3253 if (NILP (visit)) 3255 if (NILP (visit))
3254 report_file_error ("Opening input file", Fcons (orig_filename, Qnil)); 3256 report_file_error ("Opening input file", Fcons (orig_filename, Qnil));
3255 st.st_mtime = -1; 3257 st.st_mtime = -1;
@@ -4281,6 +4283,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
4281 && current_buffer->modtime == -1) 4283 && current_buffer->modtime == -1)
4282 { 4284 {
4283 /* If visiting nonexistent file, return nil. */ 4285 /* If visiting nonexistent file, return nil. */
4286 errno = save_errno;
4284 report_file_error ("Opening input file", Fcons (orig_filename, Qnil)); 4287 report_file_error ("Opening input file", Fcons (orig_filename, Qnil));
4285 } 4288 }
4286 4289
@@ -4618,7 +4621,9 @@ This calls `write-region-annotate-functions' at the start, and
4618 if (ret < 0) 4621 if (ret < 0)
4619 { 4622 {
4620#ifdef CLASH_DETECTION 4623#ifdef CLASH_DETECTION
4624 save_errno = errno;
4621 if (!auto_saving) unlock_file (lockname); 4625 if (!auto_saving) unlock_file (lockname);
4626 errno = save_errno;
4622#endif /* CLASH_DETECTION */ 4627#endif /* CLASH_DETECTION */
4623 UNGCPRO; 4628 UNGCPRO;
4624 report_file_error ("Lseek error", Fcons (filename, Qnil)); 4629 report_file_error ("Lseek error", Fcons (filename, Qnil));