No - I’m wrong…

n will be 3 which is != 2 so it will continue on...

We are having a lot of problems with Windows 7 Clients not reading the check 
point file. We can see them writing to wrapper_checkpoint_text, but they fail 
to read it correctly.

Regards
Kevin



On 21 Apr 2015, at 13:34, Kevin VINSEN 
<[email protected]<mailto:[email protected]>> wrote:

I think I’ve found a bug in the BOINC wrapper for checkpointing

Line 973 of wrapper.c is the read_checkpoint function.


int read_checkpoint(int& ntasks_completed, double& cpu, double& rt) {
    int nt;
    double c, r;

    ntasks_completed = 0;
    cpu = 0;
    FILE* f = fopen(CHECKPOINT_FILENAME, "r");
    if (!f) return ERR_FOPEN;
    int n = fscanf(f, "%d %lf %lf", &nt, &c, &r);
    fclose(f);
    if (n != 2) return 0;
    ntasks_completed = nt;
    cpu = c;
    rt = r;
    return 0;
}

The fscanf is scanning 3 parameters not 2.

Regards
Kevin




_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.

Reply via email to