Commit 74822f64b072b4fa250690290abb36f31c66f705

Werner Lemberg 2020-12-02T08:32:37

[base] Don't close 'stderr' after logging. * src/base/ftdebug.c, builds/windows/ftdebug.c (ft_logging_deinit): Fix it.

diff --git a/ChangeLog b/ChangeLog
index 8c1264f..c933ceb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2020-12-02  Werner Lemberg  <wl@gnu.org>
 
+	[base] Don't close 'stderr' after logging.
+
+	* src/base/ftdebug.c, builds/windows/ftdebug.c (ft_logging_deinit):
+	Fix it.
+
+2020-12-02  Werner Lemberg  <wl@gnu.org>
+
 	* submodules/dlg: Updated to commit 9f0c8b22.
 
 2020-12-02  Werner Lemberg  <wl@gnu.org>
diff --git a/builds/windows/ftdebug.c b/builds/windows/ftdebug.c
index c8e811e..389b9d8 100644
--- a/builds/windows/ftdebug.c
+++ b/builds/windows/ftdebug.c
@@ -452,7 +452,8 @@
   FT_BASE_DEF( void )
   ft_logging_deinit( void )
   {
-    ft_fclose( ft_fileptr );
+    if ( ft_fileptr != stderr )
+      ft_fclose( ft_fileptr );
   }
 
 
diff --git a/src/base/ftdebug.c b/src/base/ftdebug.c
index e0b050d..c8340bb 100644
--- a/src/base/ftdebug.c
+++ b/src/base/ftdebug.c
@@ -439,7 +439,8 @@
   FT_BASE_DEF( void )
   ft_logging_deinit( void )
   {
-    ft_fclose( ft_fileptr );
+    if ( ft_fileptr != stderr )
+      ft_fclose( ft_fileptr );
   }