Commit 5acac34e authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(Fcopy_file): Close output before setting its times.

Close both before discarding the unwind protects.
parent bbe20e81
......@@ -1803,6 +1803,10 @@ A prefix arg makes KEEP-TIME non-nil.")
report_file_error ("I/O error", Fcons (newname, Qnil));
immediate_quit = 0;
/* Closing the output clobbers the file times on some systems. */
if (close (ofd) < 0)
report_file_error ("I/O error", Fcons (newname, Qnil));
if (input_file_statable_p)
{
if (!NILP (keep_date))
......@@ -1818,13 +1822,11 @@ A prefix arg makes KEEP-TIME non-nil.")
chmod (XSTRING (newname)->data, st.st_mode & 07777);
}
close (ifd);
/* Discard the unwind protects. */
specpdl_ptr = specpdl + count;
close (ifd);
if (close (ofd) < 0)
report_file_error ("I/O error", Fcons (newname, Qnil));
UNGCPRO;
return Qnil;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment