diff options
author | eschnett <eschnett@ec5ace1c-6809-4267-9cad-ed2f0ecfe59c> | 2012-11-21 15:59:13 +0000 |
---|---|---|
committer | eschnett <eschnett@ec5ace1c-6809-4267-9cad-ed2f0ecfe59c> | 2012-11-21 15:59:13 +0000 |
commit | 8cdf1ef7dc6456e630423e79b65812d3e7dbbcfc (patch) | |
tree | 2e243dfe904f3ee0dd1924accff393760efc2103 | |
parent | 593aad5ad8a3ee56f97a986743b530f25a23a887 (diff) |
git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/TerminationTrigger/trunk@17 ec5ace1c-6809-4267-9cad-ed2f0ecfe59c
-rw-r--r-- | src/file.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -84,6 +84,7 @@ void TerminationTrigger_CheckFile (CCTK_ARGUMENTS) FILE *file; int terminate; + int num_read; if (! termination_from_file) { @@ -104,11 +105,10 @@ void TerminationTrigger_CheckFile (CCTK_ARGUMENTS) file = fopen (get_termination_file(), "r"); if (file != NULL) { - terminate = 0; - fscanf (file, "%d", &terminate); + num_read = fscanf (file, "%d", &terminate); fclose (file); - if (terminate == 1) { + if (num_read == 1 && terminate == 1) { CCTK_INFO ("Found termination signal in termination file. " "Triggering termination..."); |