[SIGAR-82] Add /usr/local/lib/vmware to search path

This commit is contained in:
Doug MacEachern 2008-01-16 05:44:53 +00:00
parent 8a123d4d06
commit 4c522ad7ed
1 changed files with 20 additions and 8 deletions

View File

@ -76,16 +76,28 @@ public class VMControlLibrary {
}
private static File getVMwareLib() {
String location = "/usr/lib/vmware";
File lib = new File(location);
String[] locations = {
"/usr/lib/vmware",
"/usr/local/lib/vmware",
};
for (int i=0; i<locations.length; i++) {
File lib = new File(locations[i]);
if (lib.exists()) {
//running on a VMware host
return lib;
}
else {
//remote w/ api installed
return new File(location + "-api");
}
for (int i=0; i<locations.length; i++) {
File lib = new File(locations[i] + "-api");
if (lib.exists()) {
//remote w/ api installed
return lib;
}
}
return new File(locations[0]);
}
private static File getLib(String name) {