allow services file to be overridden with sigar.net.services.file property
This commit is contained in:
parent
db88e7f04a
commit
b82ab9ede1
|
@ -20,12 +20,17 @@ public class NetPortMap {
|
|||
private static Map tcpServices = null;
|
||||
|
||||
static {
|
||||
String defaultFile;
|
||||
|
||||
if (SigarLoader.IS_WIN32) {
|
||||
SERVICE_FILE = "C:\\windows\\system32\\drivers\\etc\\services";
|
||||
defaultFile = "C:\\windows\\system32\\drivers\\etc\\services";
|
||||
}
|
||||
else {
|
||||
SERVICE_FILE = "/etc/services";
|
||||
defaultFile = "/etc/services";
|
||||
}
|
||||
|
||||
SERVICE_FILE =
|
||||
System.getProperty("sigar.net.services.file", defaultFile);
|
||||
}
|
||||
|
||||
public static class IpEntry {
|
||||
|
|
Loading…
Reference in New Issue