dont require pdh.dll on NT 4.0

This commit is contained in:
Doug MacEachern 2009-03-25 14:13:56 -07:00
parent 646fc226ea
commit 6819b18af6

View File

@ -156,15 +156,19 @@ public class Sigar implements SigarProxy {
} }
private static void loadLibrary() throws SigarException { private static void loadLibrary() throws SigarException {
try {
if (SigarLoader.IS_WIN32 && if (SigarLoader.IS_WIN32 &&
System.getProperty("os.version").equals("4.0")) System.getProperty("os.version").equals("4.0"))
{ {
try {
//NT 4.0 only
String lib = String lib =
loader.findJarPath("pdh.dll") + loader.findJarPath("pdh.dll") +
File.separator + "pdh.dll"; File.separator + "pdh.dll";
loader.systemLoad(lib); loader.systemLoad(lib);
} catch (Exception e) {}
} }
try {
loader.load(); loader.load();
} catch (ArchNotSupportedException e) { } catch (ArchNotSupportedException e) {
throw new SigarException(e.getMessage()); throw new SigarException(e.getMessage());