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.
This commit is contained in:
committed by
Benoît Dejean
parent
80855eabe2
commit
afa9757a0e
@@ -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>
|
2006-04-04 Julio M. Merino Vidal <jmmv@NetBSD.org>
|
||||||
|
|
||||||
* sysdeps/freebsd/Makefile.am:
|
* sysdeps/freebsd/Makefile.am:
|
||||||
|
@@ -63,21 +63,19 @@ init_sysinfo (glibtop *server)
|
|||||||
|
|
||||||
cpuinfo->values = g_hash_table_new_full(g_str_hash,
|
cpuinfo->values = g_hash_table_new_full(g_str_hash,
|
||||||
g_str_equal,
|
g_str_equal,
|
||||||
g_free, g_free);
|
NULL, g_free);
|
||||||
|
|
||||||
cpuinfo->descriptions = g_hash_table_new_full(g_str_hash,
|
|
||||||
g_str_equal,
|
|
||||||
g_free, g_free);
|
|
||||||
|
|
||||||
g_ptr_array_add (cpuinfo->labels, "processor");
|
g_ptr_array_add (cpuinfo->labels, "processor");
|
||||||
g_hash_table_insert (cpuinfo->values, "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_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_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);
|
g_free (model);
|
||||||
|
Reference in New Issue
Block a user