From ac17691afc8b08cc111e5081bf761f1004cc9886 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 1 Jan 2003 17:00:51 +0000 Subject: [PATCH] Move the alloc_console_called static flag inside these two functions. 2003-01-01 Tor Lillqvist * glib/gmessages.c (ensure_stderr_valid, ensure_stdout_valid): Move the alloc_console_called static flag inside these two functions. --- ChangeLog | 3 ++- ChangeLog.pre-2-10 | 3 ++- ChangeLog.pre-2-12 | 3 ++- ChangeLog.pre-2-4 | 3 ++- ChangeLog.pre-2-6 | 3 ++- ChangeLog.pre-2-8 | 3 ++- glib/gmessages.c | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5ca6c23..128d56a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,8 @@ 2003-01-01 Tor Lillqvist * glib/gmessages.c (ensure_stderr_valid): New function, parallel - to ensure_stdout_valid(). #defined as empty on Unix. + to ensure_stdout_valid(). #defined as empty on Unix. Move the + alloc_console_called static flag inside these two functions. (mklevel_prefix): Do use either stderr or stdout on Windows, too. Otherwise g_warning() messages (that are just warnings, by definition) will get mixed with proper stdout output. Noticed in diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 5ca6c23..128d56a 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,7 +1,8 @@ 2003-01-01 Tor Lillqvist * glib/gmessages.c (ensure_stderr_valid): New function, parallel - to ensure_stdout_valid(). #defined as empty on Unix. + to ensure_stdout_valid(). #defined as empty on Unix. Move the + alloc_console_called static flag inside these two functions. (mklevel_prefix): Do use either stderr or stdout on Windows, too. Otherwise g_warning() messages (that are just warnings, by definition) will get mixed with proper stdout output. Noticed in diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 5ca6c23..128d56a 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,7 +1,8 @@ 2003-01-01 Tor Lillqvist * glib/gmessages.c (ensure_stderr_valid): New function, parallel - to ensure_stdout_valid(). #defined as empty on Unix. + to ensure_stdout_valid(). #defined as empty on Unix. Move the + alloc_console_called static flag inside these two functions. (mklevel_prefix): Do use either stderr or stdout on Windows, too. Otherwise g_warning() messages (that are just warnings, by definition) will get mixed with proper stdout output. Noticed in diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 5ca6c23..128d56a 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,7 +1,8 @@ 2003-01-01 Tor Lillqvist * glib/gmessages.c (ensure_stderr_valid): New function, parallel - to ensure_stdout_valid(). #defined as empty on Unix. + to ensure_stdout_valid(). #defined as empty on Unix. Move the + alloc_console_called static flag inside these two functions. (mklevel_prefix): Do use either stderr or stdout on Windows, too. Otherwise g_warning() messages (that are just warnings, by definition) will get mixed with proper stdout output. Noticed in diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 5ca6c23..128d56a 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,7 +1,8 @@ 2003-01-01 Tor Lillqvist * glib/gmessages.c (ensure_stderr_valid): New function, parallel - to ensure_stdout_valid(). #defined as empty on Unix. + to ensure_stdout_valid(). #defined as empty on Unix. Move the + alloc_console_called static flag inside these two functions. (mklevel_prefix): Do use either stderr or stdout on Windows, too. Otherwise g_warning() messages (that are just warnings, by definition) will get mixed with proper stdout output. Noticed in diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 5ca6c23..128d56a 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,7 +1,8 @@ 2003-01-01 Tor Lillqvist * glib/gmessages.c (ensure_stderr_valid): New function, parallel - to ensure_stdout_valid(). #defined as empty on Unix. + to ensure_stdout_valid(). #defined as empty on Unix. Move the + alloc_console_called static flag inside these two functions. (mklevel_prefix): Do use either stderr or stdout on Windows, too. Otherwise g_warning() messages (that are just warnings, by definition) will get mixed with proper stdout output. Noticed in diff --git a/glib/gmessages.c b/glib/gmessages.c index 9077408..d2b8efb 100644 --- a/glib/gmessages.c +++ b/glib/gmessages.c @@ -87,7 +87,6 @@ static GLogLevelFlags g_log_msg_prefix = G_LOG_LEVEL_ERROR | G_LOG_LEVEL_WARNING # include # undef STRICT # include /* For _getpid() */ -static gboolean alloc_console_called = FALSE; static gboolean win32_keep_fatal_message = FALSE; /* This default message will usually be overwritten. */ @@ -122,6 +121,7 @@ dowrite (GFileDescriptor fd, static void ensure_stdout_valid (void) { + static gboolean alloc_console_called = FALSE; HANDLE handle; if (win32_keep_fatal_message) @@ -143,6 +143,7 @@ ensure_stdout_valid (void) static void ensure_stderr_valid (void) { + static gboolean alloc_console_called = FALSE; HANDLE handle; if (win32_keep_fatal_message) -- 2.7.4