diff options
Diffstat (limited to 'hardinfo2')
-rw-r--r-- | hardinfo2/binreloc.c | 15 | ||||
-rw-r--r-- | hardinfo2/hardinfo.c | 23 | ||||
-rw-r--r-- | hardinfo2/socket.c | 2 | ||||
-rw-r--r-- | hardinfo2/util.c | 6 | ||||
-rw-r--r-- | hardinfo2/x_util.c | 6 |
5 files changed, 35 insertions, 17 deletions
diff --git a/hardinfo2/binreloc.c b/hardinfo2/binreloc.c index f47a3fae..d0a00570 100644 --- a/hardinfo2/binreloc.c +++ b/hardinfo2/binreloc.c @@ -1,13 +1,20 @@ /* * BinReloc - a library for creating relocatable executables * Written by: Hongli Lai <h.lai@chello.nl> + * Copyright: hardinfo2 project * http://autopackage.org/ * - * This source code is public domain. You can relicense this code - * under whatever license you want. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License v2.0 or later. * - * See http://autopackage.org/docs/binreloc/ for - * more information and how to use this. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __BINRELOC_C__ diff --git a/hardinfo2/hardinfo.c b/hardinfo2/hardinfo.c index e2f11cdf..218b4298 100644 --- a/hardinfo2/hardinfo.c +++ b/hardinfo2/hardinfo.c @@ -2,9 +2,9 @@ * HardInfo - Displays System Information * Copyright (C) 2003-2009 L. A. F. Pereira <l@tia.mat.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 - * the Free Software Foundation, version 2 or later. + * it under the terms of the GNU General Public License v2.0 or later. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #include <config.h> #include <shell.h> @@ -58,16 +59,17 @@ int main(int argc, char **argv) g_print(_("Compile-time options:\n" " Release version: %s (%s)\n" + " LibSoup version: %s\n" " BinReloc enabled: %s\n" " Data prefix: %s\n" " Library prefix: %s\n" " Compiled for: %s\n"), - RELEASE ? _("Yes") : "No (" VERSION ")", ARCH, + RELEASE==1 ? "Yes (" VERSION ")" : (RELEASE==0?"No (" VERSION ")":"Debug (" VERSION ")"), ARCH, + HARDINFO2_LIBSOUP3 ? _("3.0") : "2.4", ENABLE_BINRELOC ? _("Yes") : _("No"), PREFIX, LIBPREFIX, PLATFORM); - DEBUG(" Debugging is enabled."); - + return 0; } /* initialize the binreloc library, so we can load program data */ @@ -106,7 +108,7 @@ int main(int argc, char **argv) result = module_call_method_param("benchmark::runBenchmark", params.run_benchmark); if (!result) { - fprintf(stderr, _("Unknown benchmark ``%s''"), params.run_benchmark); + fprintf(stderr, _("Unknown benchmark ``%s''\n"), params.run_benchmark); exit_code = 1; } else { fprintf(stderr, "\n"); @@ -127,6 +129,10 @@ int main(int argc, char **argv) /* generate report */ gchar *report; + if(params.bench_user_note) {//synchronize without sending benchmarks + sync_manager_update_on_startup(0); + } + DEBUG("generating report"); report = report_create_from_module_list_format(modules, @@ -134,6 +140,11 @@ int main(int argc, char **argv) report_format); g_print("%s", report); + if(params.bench_user_note) {//synchronize + if(!params.skip_benchmarks) + sync_manager_update_on_startup(1); + } + g_free(report); } else { g_error(_("Don't know what to do. Exiting.")); diff --git a/hardinfo2/socket.c b/hardinfo2/socket.c index b94e43c2..1acd86de 100644 --- a/hardinfo2/socket.c +++ b/hardinfo2/socket.c @@ -40,7 +40,7 @@ Socket *sock_connect(gchar * host, gint port) if (sock > 0) { memset(&server, 0, sizeof(server)); server.sin_family = AF_INET; - server.sin_addr.s_addr = inet_addr(host); + inet_pton(AF_INET,host,&server.sin_addr.s_addr); server.sin_port = htons(port); if (connect(sock, (struct sockaddr *) (void *) &server, sizeof(server)) < 0) { diff --git a/hardinfo2/util.c b/hardinfo2/util.c index cbabcc53..516ddb0c 100644 --- a/hardinfo2/util.c +++ b/hardinfo2/util.c @@ -90,7 +90,7 @@ gchar *seconds_to_string(unsigned int seconds) { unsigned int hours, minutes, days; const gchar *days_fmt, *hours_fmt, *minutes_fmt, *seconds_fmt; - gchar *full_fmt, *ret = g_strdup(""); + gchar *full_fmt=NULL, *ret = g_strdup(""); minutes = seconds / 60; seconds %= 60; @@ -416,13 +416,13 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param) .short_name = 'b', .arg = G_OPTION_ARG_STRING, .arg_data = &run_benchmark, - .description = N_("run benchmark eg. -b 'FPU FFT'")}, + .description = N_("run single benchmark eg. -b 'FPU FFT' (Default all Benchmarks runs)")}, { .long_name = "user-note", .short_name = 'u', .arg = G_OPTION_ARG_STRING, .arg_data = &bench_user_note, - .description = N_("note attached to benchmark results")}, + .description = N_("user note attached to benchmark results. (updating/synchronize with server)")}, { .long_name = "result-format", .short_name = 'g', diff --git a/hardinfo2/x_util.c b/hardinfo2/x_util.c index 2a7febb4..95e3274d 100644 --- a/hardinfo2/x_util.c +++ b/hardinfo2/x_util.c @@ -156,7 +156,7 @@ gboolean fill_xrr_info(xrr_info *xrr) { x_screen ts; x_output to; - char output_id[128]; + char output_id[64]; char status[128]; char alist[512]; @@ -195,7 +195,7 @@ gboolean fill_xrr_info(xrr_info *xrr) { /* looking for: * <output_id> (connected|disconnected|unknown connection) (primary|?) <%dx%d+%d+%d> (attribute_list) mm x mm */ - ec = sscanf(p, "%127s %127[^(](%511[^)]", output_id, status, alist); + ec = sscanf(p, "%63s %127[^(](%511[^)]", output_id, status, alist); if (ec == 3) { int is_output = 0, found_rect = 0, n = 0; gchar **ot = g_strsplit(status, " ", 0); @@ -228,7 +228,7 @@ gboolean fill_xrr_info(xrr_info *xrr) { } g_strfreev(ot); if (is_output) { - strncpy(to.name, output_id, 63); + strncpy(to.name, output_id, 64); xrr->output_count++; if (xrr->outputs == NULL) xrr->outputs = malloc(xrr->output_count * sizeof(x_output)); |