diff options
author | tradke <tradke@83718e91-0e4f-0410-abf4-91180603181f> | 2006-10-31 11:49:22 +0000 |
---|---|---|
committer | tradke <tradke@83718e91-0e4f-0410-abf4-91180603181f> | 2006-10-31 11:49:22 +0000 |
commit | b90c5d4770078e7156436dd49af3c9f77bcdfb8e (patch) | |
tree | 78076384591770c8e7b43b9f39b889f2171cfe97 /src | |
parent | 8d682d4232dc1beeaf2cb50e69d65c02d6012f5a (diff) |
Replaced assert statements with level 0 CCTK_VWarns so that the user has
a better idea why a run aborts (in this case because the source tarballs
couldn't be written to disk).
git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/Formaline/trunk@118 83718e91-0e4f-0410-abf4-91180603181f
Diffstat (limited to 'src')
-rw-r--r-- | src/output_source.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/output_source.c b/src/output_source.c index 44f1416..151362e 100644 --- a/src/output_source.c +++ b/src/output_source.c @@ -1,6 +1,5 @@ /* $Header$ */ -#include <assert.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> @@ -61,7 +60,11 @@ Formaline_OutputSource (CCTK_ARGUMENTS) out_dir, output_source_subdirectory, cactus_source[count]->thorn); file = fopen (filename, "w"); - assert (file); + if (file == NULL) + { + CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING, + "Failed to open source file '%s' for writing", filename); + } for (datainfo = cactus_source[count]->first; datainfo; datainfo = datainfo->next) @@ -75,7 +78,11 @@ Formaline_OutputSource (CCTK_ARGUMENTS) snprintf (filename, sizeof filename, "%s/%s/README", out_dir, output_source_subdirectory); file = fopen (filename, "w"); - assert (file); + if (file == NULL) + { + CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING, + "Failed to open README file '%s' for writing", filename); + } fprintf (file, "README for the Cactus source tree\n" "\n" |