summaryrefslogtreecommitdiff
path: root/src/dosfns.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2008-08-23 16:50:44 +0000
committerEli Zaretskii <eliz@gnu.org>2008-08-23 16:50:44 +0000
commitc06981c06286a000c3046af21fb65d07748d8462 (patch)
tree2f8184f22630dfdf1da0207b81f7c42835d36fba /src/dosfns.c
parent4e389d323caa5bb11aa61c349473eaac4caa4767 (diff)
downloademacs-c06981c06286a000c3046af21fb65d07748d8462.tar.gz
Include frame.h before termhooks.h.
(dos_cleanup): Use CURTTY ()->termscript instead of a global variable termscript.
Diffstat (limited to 'src/dosfns.c')
-rw-r--r--src/dosfns.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/dosfns.c b/src/dosfns.c
index ac336c9a5df..240f19c3380 100644
--- a/src/dosfns.c
+++ b/src/dosfns.c
@@ -29,8 +29,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "lisp.h"
#include "buffer.h"
#include "termchar.h"
-#include "termhooks.h"
#include "frame.h"
+#include "termhooks.h"
#include "blockinput.h"
#include "window.h"
#include "dosfns.h"
@@ -536,15 +536,27 @@ If the underlying system call fails, value is nil. */)
void
dos_cleanup (void)
{
+ struct tty_display_info *tty;
+
#ifndef HAVE_X_WINDOWS
restore_parent_vm_title ();
#endif
/* Make sure the termscript file is committed, in case we are
crashing and some vital info was written there. */
- if (termscript)
+ if (FRAMEP (selected_frame))
{
- fflush (termscript);
- fsync (fileno (termscript));
+ struct frame *sf = XFRAME (selected_frame);
+
+ if (FRAME_LIVE_P (sf)
+ && (FRAME_MSDOS_P (sf) || FRAME_TERMCAP_P (sf)))
+ {
+ tty = CURTTY ();
+ if (tty->termscript)
+ {
+ fflush (tty->termscript);
+ fsync (fileno (tty->termscript));
+ }
+ }
}
}