summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-09-21 10:48:19 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-09-21 10:48:19 -0700
commit4c0078d4ab7fa8c234fa8098ec3a9686199edbff (patch)
tree94584f6a647d7d9ab5da97842dcc37e75d6c03fe /src/fileio.c
parentd311d28c3f8a3c43e6ef33d68b852c5ea7f13239 (diff)
parente233ce558d12fdf9e0e69ea30c4558ec7477fea4 (diff)
downloademacs-4c0078d4ab7fa8c234fa8098ec3a9686199edbff.tar.gz
Merge from trunk.
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 486c3d4c175..110977b3a60 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3189,6 +3189,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
Lisp_Object p;
ptrdiff_t total = 0;
int not_regular = 0;
+ int save_errno = 0;
char read_buf[READ_BUF_SIZE];
struct coding_system coding;
char buffer[1 << 14];
@@ -3253,6 +3254,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
#endif /* WINDOWSNT */
{
badopen:
+ save_errno = errno;
if (NILP (visit))
report_file_error ("Opening input file", Fcons (orig_filename, Qnil));
st.st_mtime = -1;
@@ -4288,6 +4290,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
&& current_buffer->modtime == -1)
{
/* If visiting nonexistent file, return nil. */
+ errno = save_errno;
report_file_error ("Opening input file", Fcons (orig_filename, Qnil));
}
@@ -4625,7 +4628,9 @@ This calls `write-region-annotate-functions' at the start, and
if (ret < 0)
{
#ifdef CLASH_DETECTION
+ save_errno = errno;
if (!auto_saving) unlock_file (lockname);
+ errno = save_errno;
#endif /* CLASH_DETECTION */
UNGCPRO;
report_file_error ("Lseek error", Fcons (filename, Qnil));