diff --git a/sysdeps/freebsd/ChangeLog b/sysdeps/freebsd/ChangeLog index cb3b7a48..5bcd3241 100644 --- a/sysdeps/freebsd/ChangeLog +++ b/sysdeps/freebsd/ChangeLog @@ -1,3 +1,12 @@ +2006-04-04 BenoƮt Dejean + + * sysinfo.c: (init_sysinfo): + + Store only strings in values' values. g_strdup these strings. + Even if values is never destroyed, set key_destroy_func to NULL. + + Leave description to NULL. + 2006-04-04 Julio M. Merino Vidal * sysdeps/freebsd/Makefile.am: diff --git a/sysdeps/freebsd/sysinfo.c b/sysdeps/freebsd/sysinfo.c index 8a44167b..10cbd6f3 100644 --- a/sysdeps/freebsd/sysinfo.c +++ b/sysdeps/freebsd/sysinfo.c @@ -63,21 +63,19 @@ init_sysinfo (glibtop *server) cpuinfo->values = g_hash_table_new_full(g_str_hash, g_str_equal, - g_free, g_free); - - cpuinfo->descriptions = g_hash_table_new_full(g_str_hash, - g_str_equal, - g_free, g_free); + NULL, g_free); g_ptr_array_add (cpuinfo->labels, "processor"); g_hash_table_insert (cpuinfo->values, "processor", - &sysinfo.ncpu); + g_strdup_printf("%u", (guint)sysinfo.ncpu)); g_ptr_array_add (cpuinfo->labels, "vendor_id"); - g_hash_table_insert (cpuinfo->values, "vendor_id", model); + g_hash_table_insert (cpuinfo->values, "vendor_id", + g_strdup(model)); g_ptr_array_add (cpuinfo->labels, "cpu MHz"); - g_hash_table_insert (cpuinfo->values, "cpu MHz", &mhz); + g_hash_table_insert (cpuinfo->values, "cpu MHz", + g_strdup_printf("%d", mhz)); } g_free (model);