diff --git a/api/api.C b/api/api.C index e1d909aaf1..17ba53fcaf 100644 --- a/api/api.C +++ b/api/api.C @@ -267,7 +267,7 @@ int boinc_resolve_link(char *file_name, char *resolved_name) return 0; } -bool checkpoint = false; +bool _checkpoint = false; double get_cpu_time() { int retval, pid = getpid(); @@ -299,12 +299,12 @@ int checkpoint_completed() { fprintf(stderr, "error: could not close %s\n", APP_TO_CORE_FILE); return retval; } - checkpoint = false; + _checkpoint = false; return 0; } void on_timer(int a) { - checkpoint = true; + _checkpoint = true; } int set_timer(int period) { diff --git a/api/api.h b/api/api.h index 6036e6c184..7fb5c82edb 100644 --- a/api/api.h +++ b/api/api.h @@ -96,8 +96,8 @@ int boinc_resolve_link(char *file_name, char *resolved_name); #define BOINC_INIT_FILE "boinc_init.xml" //the following are provided for implementation of the checkpoint system -extern bool checkpoint; -#define time_to_checkpoint() checkpoint +extern bool _checkpoint; +#define time_to_checkpoint() _checkpoint int checkpoint_completed(); int set_timer(int period); //period is seconds spent in process void on_timer(int not_used); diff --git a/apps/upper_case.C b/apps/upper_case.C index 5f2e5f409e..ef252738dd 100755 --- a/apps/upper_case.C +++ b/apps/upper_case.C @@ -37,6 +37,10 @@ int main() { c = toupper(c); putchar(c); n++; + if(time_to_checkpoint()) { + fflush(stdout); + checkpoint_completed(); + } } fprintf(stderr, "APP: upper_case ending, wrote %d chars\n", n); return 0; diff --git a/test/prefs1.xml b/test/prefs1.xml index b85e995a71..7cad08a019 100644 --- a/test/prefs1.xml +++ b/test/prefs1.xml @@ -4,7 +4,7 @@ 1 1 - http://localhost/boinc-cgi/index.html + http://localhost/index.html 3f7b90793a0175ad0bda68684e8bd136