diff options
Diffstat (limited to 'arch/common/zlib.h')
-rw-r--r-- | arch/common/zlib.h | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/arch/common/zlib.h b/arch/common/zlib.h index 2a1007ed..96d20944 100644 --- a/arch/common/zlib.h +++ b/arch/common/zlib.h @@ -1,6 +1,6 @@ /* * HardInfo - Displays System Information - * Copyright (C) 2003-2006 Leandro A. F. Pereira <leandro@linuxmag.com.br> + * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static gchar * +static void benchmark_zlib(void) { GModule *libz; @@ -27,11 +27,10 @@ benchmark_zlib(void) if (!(compress && compressBound)) { libz = g_module_open("libz", G_MODULE_BIND_LAZY); if (!libz) { - libz = g_module_open("/lib/libz.so", G_MODULE_BIND_LAZY); + libz = g_module_open("/usr/lib/libz.so", G_MODULE_BIND_LAZY); if (!libz) { g_warning("Cannot load ZLib: %s", g_module_error()); - return g_strdup("[Error]\n" - "ZLib not found="); + return; } } @@ -39,8 +38,7 @@ benchmark_zlib(void) || !g_module_symbol(libz, "compressBound", (gpointer) & compressBound)) { g_module_close(libz); - return g_strdup("[Error]\n" - "Invalid Z-Lib found="); + return; } } @@ -53,13 +51,10 @@ benchmark_zlib(void) glong srclen = 65536; gchar *bdata_path; - bdata_path = g_strdup_printf("%s/hardinfo/benchmark.data", - gbr_find_data_dir(PREFIX)); - + bdata_path = g_build_filename(params.path_data, "benchmark.data", NULL); if (!g_file_get_contents(bdata_path, &tmpsrc, NULL, NULL)) { g_free(bdata_path); - return g_strdup("[Error]\n" - PREFIX "benchmark.data not found=\n"); + return; } shell_status_update("Compressing 64MB with default options..."); @@ -82,9 +77,6 @@ benchmark_zlib(void) g_timer_destroy(timer); g_free(bdata_path); - - gchar *retval = g_strdup_printf("[Results <i>(in seconds; lower is better)</i>]\n" - "<b>This Machine</b>=<b>%.2f</b>\n", elapsed); - return benchmark_include_results(retval, "ZLib"); + + bench_results[BENCHMARK_ZLIB] = 65536.0 / elapsed; } - |