Localize utsname

Signed-off-by: Carlo Marcelo Arenas Belon <[EMAIL PROTECTED]>
---
 trunk/monitor-core/libmetrics/aix/metrics.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/trunk/monitor-core/libmetrics/aix/metrics.c 
b/trunk/monitor-core/libmetrics/aix/metrics.c
index 31a1771..f08c5bb 100644
--- a/trunk/monitor-core/libmetrics/aix/metrics.c
+++ b/trunk/monitor-core/libmetrics/aix/metrics.c
@@ -116,7 +116,6 @@ struct cpuinfo_stats {
 
 static int aixver, aixrel, aixlev, aixfix;
 static time_t boottime;
-struct utsname unames;
 
 /* Prototypes
  */
@@ -133,10 +132,6 @@ metric_init(void)
    g_val_t val;
 
    update_ifdata();
-   uname(&unames);
-   
-   update_ifdata();
-
    bos_level(&aixver, &aixrel, &aixlev, &aixfix);
 
    val.int32 = SYNAPSE_SUCCESS;
@@ -212,7 +207,11 @@ g_val_t
 os_name_func ( void )
 {
    g_val_t val;
-   strncpy( val.str, unames.sysname, MAX_G_STRING_SIZE );
+   struct utsname uts;
+
+   uname (&uts);
+   strncpy (val.str, uts.sysname, MAX_G_STRING_SIZE);
+
    return val;
 }        
 
-- 
1.5.3.7


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ganglia-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to