diff options
author | Benoît Dejean <benoit@placenet.org> | 2006-04-04 21:23:46 +0000 |
---|---|---|
committer | Benoît Dejean <bdejean@src.gnome.org> | 2006-04-04 21:23:46 +0000 |
commit | afa9757a0e7c15a7e41de872e0f540a67a8e2d36 (patch) | |
tree | a19a104ad7211f8d91417f58c4d15bbd68cc31a7 | |
parent | 80855eabe2cc0d774f26549a095ee88755f1adf5 (diff) | |
download | libgtop-afa9757a0e7c15a7e41de872e0f540a67a8e2d36.tar.gz |
Store only strings in values' values. g_strdup these strings. Even if
2006-04-04 Benoît Dejean <benoit@placenet.org>
* 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.
-rw-r--r-- | sysdeps/freebsd/ChangeLog | 9 | ||||
-rw-r--r-- | sysdeps/freebsd/sysinfo.c | 14 |
2 files changed, 15 insertions, 8 deletions
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 <benoit@placenet.org> + + * 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 <jmmv@NetBSD.org> * 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); |