- vboxwrapper: if shared dir is specified and it doesn't exist on startup,

that's not necessarily an error.
    Try to create it.
    If it exists and is a file, show appropriate error message.


svn path=/trunk/boinc/; revision=24824
This commit is contained in:
David Anderson 2011-12-19 19:00:19 +00:00
parent 0777ab174a
commit c164349afc
2 changed files with 27 additions and 12 deletions

View File

@ -9113,3 +9113,12 @@ David 17 Dec 2011
sched/
sched_types.h
sched_version.cpp
David 19 Dec 2011
- vboxwrapper: if shared dir is specified and it doesn't exist on startup,
that's not necessarily an error.
Try to create it.
If it exists and is a file, show appropriate error message.
samples/vboxwrapper/
vboxwrapper.cpp

View File

@ -26,8 +26,6 @@
// - suspend/resume/quit/abort
// - reporting CPU time
// - loss of heartbeat from core client
// - checkpointing
// (at the level of task; or potentially within task)
//
// Contributors:
// Andrew J. Younge (ajy4490 AT umiacs DOT umd DOT edu)
@ -211,17 +209,25 @@ int main(int argc, char** argv) {
}
// Validate whatever configuration options we can
//
if (vm.enable_shared_directory) {
if (!is_dir("shared")) {
fprintf(
stderr,
"%s vbox_job.xml specifies that the shared directory should be enabled, but the\n"
"%s 'shared' subdirectory could not be found. Please check your app_version and verify\n"
"%s that the <file_prefix> element has been specified.\n",
boinc_msg_prefix(buf, sizeof(buf)),
boinc_msg_prefix(buf, sizeof(buf)),
boinc_msg_prefix(buf, sizeof(buf))
);
if (boinc_file_exists("shared")) {
if (!is_dir("shared")) {
fprintf(
stderr,
"%s 'shared' exists but is not a directory.\n",
boinc_msg_prefix(buf, sizeof(buf))
);
}
} else {
retval = boinc_mkdir("shared");
if (retval) {
fprintf(stderr,
"%s couldn't created shared directory: %s.\n",
boinc_msg_prefix(buf, sizeof(buf)),
boincerror(retval)
);
}
}
}