From 9e98a05fc76fdc00c4ec37880380c72f03378489 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 11 Jul 2005 20:41:57 +0000 Subject: [PATCH] rename net_info.domain to domain_name --- bindings/java/src/jni/generate.pl | 2 +- bindings/java/src/net/hyperic/sigar/cmd/NetInfo.java | 4 ++-- include/sigar.h | 2 +- src/sigar.c | 8 +++++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/bindings/java/src/jni/generate.pl b/bindings/java/src/jni/generate.pl index 2cc05b17..b7b610ac 100644 --- a/bindings/java/src/jni/generate.pl +++ b/bindings/java/src/jni/generate.pl @@ -569,7 +569,7 @@ my %classes = ( plat => '' }, { - name => 'domain', type => 'String', + name => 'domain_name', type => 'String', desc => '', plat => '' }, diff --git a/bindings/java/src/net/hyperic/sigar/cmd/NetInfo.java b/bindings/java/src/net/hyperic/sigar/cmd/NetInfo.java index e1dedb3f..ab97d69c 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/NetInfo.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/NetInfo.java @@ -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()); diff --git a/include/sigar.h b/include/sigar.h index e68f7e9d..b2f598f6 100644 --- a/include/sigar.h +++ b/include/sigar.h @@ -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]; diff --git a/src/sigar.c b/src/sigar.c index 57e9db40..895e8580 100644 --- a/src/sigar.c +++ b/src/sigar.c @@ -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;