diff --git a/checkin_notes b/checkin_notes index b650e9f128..f1ffeab25c 100755 --- a/checkin_notes +++ b/checkin_notes @@ -12582,3 +12582,19 @@ David May 24 2004 whetstone.C lib/ util.C,h + +David May 24 2004 + - boinc_delete_file(): Windows: retry 5 times w/ 1 second delay + (in case virus-check program has file locked). + This may fix a problem where slot directories + weren't getting cleaned up. + - if clean_out_dirs() fails when starting app, + print error message and return error (so app won't start) + + client/ + app.C + cpu_benchmark.h + cs_benchmark.C + file_names.C + lib/ + filesys.C,h diff --git a/client/app.C b/client/app.C index 706dae63c1..3930e1d818 100644 --- a/client/app.C +++ b/client/app.C @@ -604,7 +604,14 @@ int ACTIVE_TASK_SET::insert(ACTIVE_TASK* atp) { int retval; get_slot_dir(atp->slot, atp->slot_dir); - clean_out_dir(atp->slot_dir); + retval = clean_out_dir(atp->slot_dir); + if (retval) { + msg_printf(atp->result->project, MSG_ERROR, + "ACTIVE_TASK_SET::insert(): can't delete file %s", + boinc_failed_file + ); + return retval; + } retval = atp->start(true); if (retval) return retval; active_tasks.push_back(atp); diff --git a/client/cpu_benchmark.h b/client/cpu_benchmark.h index d0e4361fde..ebf41ec211 100644 --- a/client/cpu_benchmark.h +++ b/client/cpu_benchmark.h @@ -44,4 +44,4 @@ extern int destroy_benchmark_timer(); extern void dhrystone(double& dps, double& vax_mips); extern void whetstone(double& flops); extern void benchmark_wait_to_start(int which); -extern bool benchmark_time_to_stop(int which); \ No newline at end of file +extern bool benchmark_time_to_stop(int which); diff --git a/client/cs_benchmark.C b/client/cs_benchmark.C index b54785156e..435b3e1686 100644 --- a/client/cs_benchmark.C +++ b/client/cs_benchmark.C @@ -145,9 +145,6 @@ bool benchmark_time_to_stop(int which) { // int cpu_benchmarks(BENCHMARK_DESC* bdp) { HOST_INFO host_info; - double fpop_test_secs = 3.3; - double iop_test_secs = 3.3; - double mem_test_secs = 3.3; double x, y; host_info.clear_host_info(); @@ -155,9 +152,6 @@ int cpu_benchmarks(BENCHMARK_DESC* bdp) { dhrystone(x, y); host_info.p_iops = y*1e6; host_info.p_membw = 1e9; - //host_info.p_fpop_err = run_double_prec_test(fpop_test_secs, host_info.p_fpops); - //host_info.p_iop_err = run_int_test(iop_test_secs, host_info.p_iops); - //host_info.p_membw_err = run_mem_bandwidth_test(mem_test_secs, host_info.p_membw); host_info.m_cache = 1e6; // TODO: measure the cache #ifdef _WIN32 diff --git a/client/file_names.C b/client/file_names.C index 4b835d812e..c1469fda21 100644 --- a/client/file_names.C +++ b/client/file_names.C @@ -88,9 +88,14 @@ int make_project_dir(PROJECT& p) { int remove_project_dir(PROJECT& p) { char buf[256]; + int retval; get_project_dir(&p, buf); - clean_out_dir(buf); + retval = clean_out_dir(buf); + if (retval) { + msg_printf(&p, MSG_ERROR, "Can't delete file %s\n", boinc_failed_file); + return retval; + } return boinc_rmdir(buf); } diff --git a/lib/filesys.C b/lib/filesys.C index 7e733a59e4..328548a2f0 100755 --- a/lib/filesys.C +++ b/lib/filesys.C @@ -73,7 +73,7 @@ typedef BOOL (CALLBACK* FreeFn)(LPCTSTR, PULARGE_INTEGER, PULARGE_INTEGER, PULAR #include "fcgi_stdio.h" #endif -char failed_file[256]; +char boinc_failed_file[256]; // routines for enumerating the entries in a directory @@ -254,14 +254,17 @@ int boinc_delete_file(const char* path) { if (!boinc_file_exists(path)) { return 0; } -#ifdef HAVE_UNISTD_H +#ifdef _WIN32 + for (int i=0; i<5; i++) { + retval = remove(path); + if (!retval) break; + boinc_sleep(1.0); + } +#else retval = unlink(path); -#endif -#if ( defined(_WIN32) || defined(macintosh) ) - retval = remove(path); #endif if (retval) { - safe_strcpy(failed_file, path); + safe_strcpy(boinc_failed_file, path); return ERR_UNLINK; } return 0; diff --git a/lib/filesys.h b/lib/filesys.h index 8416a043e0..9adc90fe9a 100755 --- a/lib/filesys.h +++ b/lib/filesys.h @@ -74,6 +74,7 @@ extern int lock_file(char*); extern void relative_to_absolute(char* relname, char* path); extern int get_filesystem_info(double& total, double& free); extern int boinc_make_dirs(char*, char*); +extern char boinc_failed_file[256]; class DirScanner { #ifdef _WIN32