diff options
| author | Paul Eggert | 2013-07-16 14:49:32 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-07-16 14:49:32 -0700 |
| commit | 41d48a42df6ce4e5af9543f97313e256f16aa900 (patch) | |
| tree | 2c23587c2691d181eb1561ee7347924887f73e53 /src/lisp.h | |
| parent | 27e498e6e5fea8ac64c90ac13678b537b7b12302 (diff) | |
| download | emacs-41d48a42df6ce4e5af9543f97313e256f16aa900.tar.gz emacs-41d48a42df6ce4e5af9543f97313e256f16aa900.zip | |
Fix bug where insert-file-contents closes a file twice.
* fileio.c (close_file_unwind): Don't close if FD is negative;
this can happen when unwinding a zapped file descriptor.
(Finsert_file_contents): Unwind-protect the fd before the point marker,
in case Emacs runs out of memory between the two unwind-protects.
Don't trash errno when closing FD.
Zap the FD in the specpdl when closing it, instead of deferring
the removal of the unwind-protect; this fixes a bug where a child
function unwinds the stack past us.
Fixes: debbugs:14839
Diffstat (limited to 'src/lisp.h')
| -rw-r--r-- | src/lisp.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h index 38413f831dc..26e9e18ec9a 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2750,6 +2750,12 @@ set_unwind_protect_ptr (ptrdiff_t count, void *arg) | |||
| 2750 | specpdl[count].unwind_ptr.arg = arg; | 2750 | specpdl[count].unwind_ptr.arg = arg; |
| 2751 | } | 2751 | } |
| 2752 | 2752 | ||
| 2753 | LISP_INLINE void | ||
| 2754 | set_unwind_protect_int (ptrdiff_t count, int arg) | ||
| 2755 | { | ||
| 2756 | specpdl[count].unwind_int.arg = arg; | ||
| 2757 | } | ||
| 2758 | |||
| 2753 | /* Everything needed to describe an active condition case. | 2759 | /* Everything needed to describe an active condition case. |
| 2754 | 2760 | ||
| 2755 | Members are volatile if their values need to survive _longjmp when | 2761 | Members are volatile if their values need to survive _longjmp when |