wrapper: fix do_zip_outputs(): resolve the zipfilename before checking for existence

This commit is contained in:
Bernd Machenschalk 2016-03-03 22:52:25 +01:00 committed by Christian Beer
parent 79168e1254
commit a0a0dd2ac5
1 changed files with 3 additions and 3 deletions

View File

@ -363,7 +363,9 @@ void get_zip_inputs(ZipFileList &files) {
//
void do_zip_outputs() {
if (zip_filename.empty()) return;
if (boinc_file_exists(zip_filename.c_str())) return;
string path;
boinc_resolve_filename_s(zip_filename.c_str(), path);
if (boinc_file_exists(path.c_str())) return;
ZipFileList infiles;
get_zip_inputs(infiles);
int retval = boinc_zip(ZIP_IT, string("temp.zip"), &infiles);
@ -371,8 +373,6 @@ void do_zip_outputs() {
fprintf(stderr, "boinc_zip() failed: %d\n", retval);
exit(1);
}
string path;
boinc_resolve_filename_s(zip_filename.c_str(), path);
retval = boinc_rename("temp.zip", path.c_str());
if (retval) {
fprintf(stderr, "failed to rename temp.zip: %d\n", retval);