diff options
author | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2004-04-06 13:29:05 +0000 |
---|---|---|
committer | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2004-04-06 13:29:05 +0000 |
commit | 41e2d8ad7facf955a8b8187d6dc12cee50b4f8ad (patch) | |
tree | 18f3d50383456b365363b72bf0760dd79c427479 /src/main/WarnLevel.c | |
parent | 82800bb5365187c314c4a178f391fa101f257bad (diff) |
Flush stdout before printing to stderr.
Don't flush stderr twice.
Call CCTK_Abort instead of exit.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@3648 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/WarnLevel.c')
-rw-r--r-- | src/main/WarnLevel.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/WarnLevel.c b/src/main/WarnLevel.c index ded90d9d..4d7cfeb5 100644 --- a/src/main/WarnLevel.c +++ b/src/main/WarnLevel.c @@ -482,6 +482,7 @@ int CCTK_ParamWarn (const char *thorn, const char *message) cctk_strong_param_check = (const CCTK_INT *) CCTK_ParameterGet ("cctk_strong_param_check", "Cactus", ¶m_type); + fflush (stdout); fprintf (stderr, "PARAM %s (%s): %s\n", *cctk_strong_param_check ? "ERROR" : "WARNING", thorn, message); fflush (stderr); @@ -542,6 +543,7 @@ int CCTK_VParamWarn (const char *thorn, cctk_strong_param_check = (const CCTK_INT *) CCTK_ParameterGet ("cctk_strong_param_check", "Cactus", ¶m_type); + fflush (stdout); fprintf (stderr, "PARAM %s (%s): ", *cctk_strong_param_check ? "ERROR" : "WARNING", thorn); @@ -551,7 +553,6 @@ int CCTK_VParamWarn (const char *thorn, fflush (stderr); va_end (ap); - fflush (stderr); param_errors++; return (0); @@ -763,11 +764,12 @@ void CCTKi_FinaliseParamWarn (void) cctk_strong_param_check = (const CCTK_INT *) CCTK_ParameterGet ("cctk_strong_param_check", "Cactus", ¶m_type); + fflush (stdout); if (*cctk_strong_param_check) { fprintf (stderr, "\nFailed parameter check (%d errors)\n\n", param_errors); fflush (stderr); - exit (99); + CCTK_Abort (NULL, 99); } else { |