diff --git a/api/api.C b/api/api.C index 674096adc1..3a62fe666f 100644 --- a/api/api.C +++ b/api/api.C @@ -283,9 +283,8 @@ double get_cpu_time() { #endif } -int checkpoint_completed() { +int checkpoint_completed(APP_OUT &ao) { int retval; - APP_OUT ao; FILE *f = fopen(APP_TO_CORE_FILE, "w"); ao.cpu_time_at_checkpoint = get_cpu_time(); write_app_file(f, ao); diff --git a/api/api.h b/api/api.h index d8d44be7c1..9fedf53f5c 100644 --- a/api/api.h +++ b/api/api.h @@ -98,7 +98,7 @@ int boinc_resolve_link(char *file_name, char *resolved_name); //the following are provided for implementation of the checkpoint system extern bool _checkpoint; #define time_to_checkpoint() _checkpoint -int checkpoint_completed(); +int checkpoint_completed(APP_OUT &ao); int set_timer(double period); //period is seconds spent in process void on_timer(int not_used); double get_cpu_time(); //return cpu time for this process diff --git a/api/api_test.C b/api/api_test.C index 59635ece41..bb7bb250a4 100644 --- a/api/api_test.C +++ b/api/api_test.C @@ -26,6 +26,7 @@ int main() { unsigned long int i = 0; int temp=0; APP_IN ai; + APP_OUT ao; boinc_init(ai); mf.open("foobar", "w"); mf.printf("blah %d %f\n", 17, 34.5); @@ -34,7 +35,8 @@ int main() { if(time_to_checkpoint()) { mf.printf("checkpoint\n"); mf.flush(); - checkpoint_completed(); + ao.percent_done = 1; + checkpoint_completed(ao); } temp++; }