diff options
author | eschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2011-08-13 18:57:05 +0000 |
---|---|---|
committer | eschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2011-08-13 18:57:05 +0000 |
commit | ee5b89f39619c06dd5d6f103eb5e4eac5135946b (patch) | |
tree | 424451037a101d535be1838280a00dbebaf8c07d /src/main/WarnLevel.c | |
parent | 9dfdf64bce8369cf0a0c8d24ee3056eece974b80 (diff) |
Flush stdout and stderr before and after outputting a parameter
warning. This helps prevent mixing of stdout and stderr when both are
redirected to the same file.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4714 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/WarnLevel.c')
-rw-r--r-- | src/main/WarnLevel.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/WarnLevel.c b/src/main/WarnLevel.c index a315ad73..c5557ffe 100644 --- a/src/main/WarnLevel.c +++ b/src/main/WarnLevel.c @@ -741,6 +741,8 @@ int CCTK_VParamWarn (const char *thorn, highlight_warning_messages = ! highlight_warning_messages_ptr || *highlight_warning_messages_ptr; + fflush (stdout); + /* print to stderr */ if (highlight_warning_messages) { @@ -760,6 +762,8 @@ int CCTK_VParamWarn (const char *thorn, bold_stderr (OFF); } + fflush (stderr); + /* print to stdout */ if (highlight_warning_messages) { @@ -779,6 +783,8 @@ int CCTK_VParamWarn (const char *thorn, bold_stdout (OFF); } + fflush (stdout); + param_errors++; return (0); |