Commit caf52557 authored by Rom Walton's avatar Rom Walton
Browse files

VBOX: Add code to handle search path modification for Linux and Mac.

Something has changed on OS X that prevents /usr/local/bin from being in the default search path.  It is when launched from a terminal window, but not when BOINC launches vboxwrapper.  I think recent versions of VirtualBox changed where it stores VboxManage on install.  bbad0d9d recently addressed this in the CC.
parent b33025de
...@@ -86,8 +86,6 @@ int VBOX_VM::initialize() { ...@@ -86,8 +86,6 @@ int VBOX_VM::initialize() {
// Prep the environment so we can execute the vboxmanage application // Prep the environment so we can execute the vboxmanage application
// //
// TODO: Fix for non-Windows environments if we ever find another platform
// where vboxmanage is not already in the search path
#ifdef _WIN32 #ifdef _WIN32
if (!virtualbox_install_directory.empty()) if (!virtualbox_install_directory.empty())
{ {
...@@ -98,6 +96,18 @@ int VBOX_VM::initialize() { ...@@ -98,6 +96,18 @@ int VBOX_VM::initialize() {
vboxlog_msg("Failed to modify the search path."); vboxlog_msg("Failed to modify the search path.");
} }
} }
#else
old_path = getenv("PATH");
if(boinc_file_exists("/usr/local/bin/VboxManage")) {
new_path = "/usr/local/bin/:" + old_path;
}
if(boinc_file_exists("/usr/bin/VboxManage")) {
new_path = "/usr/bin/:" + old_path;
}
// putenv does not copy its input buffer, so we must use setenv
if (setenv("PATH", const_cast<char*>(new_path.c_str()), 1)) {
vboxlog_msg("Failed to modify the search path.");
}
#endif #endif
// Determine the VirtualBox home directory. Overwrite as needed. // Determine the VirtualBox home directory. Overwrite as needed.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment