From 6f855d6452fbff508a7b022350564a9f7955f7e9 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 3 Dec 1998 09:41:09 +0000 Subject: [PATCH] (dos_cleanup): Flush and fsync the termscript stream. --- src/dosfns.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dosfns.c b/src/dosfns.c index b1ba6063a37..d0f5f18dd01 100644 --- a/src/dosfns.c +++ b/src/dosfns.c @@ -469,6 +469,13 @@ dos_cleanup (void) #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) + { + fflush (termscript); + fsync (fileno (termscript)); + } } /* -- 2.39.2