From fa76afe6edbc6572f179d1dcf859f013e85ef7dd Mon Sep 17 00:00:00 2001
From: unknown <heikki@hundin.mysql.fi>
Date: Fri, 22 Nov 2002 13:59:06 +0200
Subject: [PATCH] ut0mem.c:   Flush stderr if we run out of memory, so that the
 error message more probably finds its way to the error log

innobase/ut/ut0mem.c:
  Flush stderr if we run out of memory, so that the error message more probably finds its way to the error log
---
 innobase/ut/ut0mem.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/innobase/ut/ut0mem.c b/innobase/ut/ut0mem.c
index 2a7643551a..03f15031fd 100644
--- a/innobase/ut/ut0mem.c
+++ b/innobase/ut/ut0mem.c
@@ -90,6 +90,12 @@ ut_malloc_low(
 		"InnoDB: on Linux we get a stack trace.\n",
 		                  n, ut_total_allocated_memory, errno);
 
+		/* Flush stderr to make more probable that the error
+		message gets in the error file before we generate a seg
+		fault */
+
+		fflush(stderr);
+
 	        os_fast_mutex_unlock(&ut_list_mutex);
 
 		/* Make an intentional seg fault so that we get a stack
-- 
2.30.9