diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c index 6b3bdf2154d..f954ac12b5d 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -693,10 +693,14 @@ This function does not grok magic file names. */) | |||
| 693 | bool failed = fd < 0; | 693 | bool failed = fd < 0; |
| 694 | if (!failed) | 694 | if (!failed) |
| 695 | { | 695 | { |
| 696 | ptrdiff_t count = SPECPDL_INDEX (); | ||
| 697 | record_unwind_protect_int (close_file_unwind, fd); | ||
| 696 | val = DECODE_FILE (val); | 698 | val = DECODE_FILE (val); |
| 697 | if (STRINGP (text) && SBYTES (text) != 0) | 699 | if (STRINGP (text) && SBYTES (text) != 0) |
| 698 | write_region (text, Qnil, val, Qnil, Qnil, Qnil, Qnil, fd); | 700 | write_region (text, Qnil, val, Qnil, Qnil, Qnil, Qnil, fd); |
| 699 | failed = NILP (dir_flag) && emacs_close (fd) != 0; | 701 | failed = NILP (dir_flag) && emacs_close (fd) != 0; |
| 702 | /* Discard the unwind protect. */ | ||
| 703 | specpdl_ptr = specpdl + count; | ||
| 700 | } | 704 | } |
| 701 | if (failed) | 705 | if (failed) |
| 702 | { | 706 | { |