rename net_info.domain to domain_name
This commit is contained in:
parent
b000f97bd3
commit
9e98a05fc7
|
@ -569,7 +569,7 @@ my %classes = (
|
|||
plat => ''
|
||||
},
|
||||
{
|
||||
name => 'domain', type => 'String',
|
||||
name => 'domain_name', type => 'String',
|
||||
desc => '',
|
||||
plat => ''
|
||||
},
|
||||
|
|
|
@ -23,8 +23,8 @@ public class NetInfo extends SigarCommandBase {
|
|||
net.hyperic.sigar.NetInfo info =
|
||||
this.sigar.getNetInfo();
|
||||
|
||||
println("domain................" +
|
||||
info.getDomain());
|
||||
println("domain name..........." +
|
||||
info.getDomainName());
|
||||
|
||||
println("default gateway......." +
|
||||
info.getDefaultGateway());
|
||||
|
|
|
@ -391,7 +391,7 @@ sigar_file_system_usage_get(sigar_t *sigar,
|
|||
|
||||
typedef struct {
|
||||
char default_gateway[INET6_ADDRSTRLEN];
|
||||
char domain[SIGAR_MAXDOMAINNAMELEN];
|
||||
char domain_name[SIGAR_MAXDOMAINNAMELEN];
|
||||
char dhcp_server[INET6_ADDRSTRLEN];
|
||||
char primary_dns[INET6_ADDRSTRLEN];
|
||||
char secondary_dns[INET6_ADDRSTRLEN];
|
||||
|
|
|
@ -845,6 +845,7 @@ int sigar_who_list_get(sigar_t *sigar,
|
|||
int sigar_net_info_get(sigar_t *sigar,
|
||||
sigar_net_info_t *netinfo)
|
||||
{
|
||||
int size;
|
||||
char buffer[BUFSIZ], *ptr;
|
||||
FILE *fp;
|
||||
|
||||
|
@ -880,11 +881,12 @@ int sigar_net_info_get(sigar_t *sigar,
|
|||
|
||||
fclose(fp);
|
||||
|
||||
if (getdomainname(netinfo->domain, sizeof(netinfo->domain)) == 0) {
|
||||
netinfo->domain[sizeof(netinfo->domain)-1] = '\0';
|
||||
size = sizeof(netinfo->domain_name)-1;
|
||||
if (getdomainname(netinfo->domain_name, size) == 0) {
|
||||
netinfo->domain_name[size] = '\0';
|
||||
}
|
||||
else {
|
||||
netinfo->domain[0] = '\0';
|
||||
netinfo->domain_name[0] = '\0';
|
||||
}
|
||||
|
||||
return SIGAR_OK;
|
||||
|
|
Loading…
Reference in New Issue