Package: xsensors Version: 0.70-2 Severity: important Tags: patch Dear Maintainer,
On new hardware and fresh installation, xsensors failed to start. From the command line, I got the error "GUI failed!". Tried various options, but nothing helped. After running it through gdb and seeing a problem with the command line parsing, I came up with the patch that is attached to this bug report. This fixes the command line problem. Now that I could get xsensors to handle the command line, I found another problem. When setting up the subfeatures for the chip, if it finds something other than a temp, fan, or volt feature, it stops processing sensors and displays what it has (including an empty tab for sensor it choked on). Patch forthcoming. Regards, John Vogel <[email protected]> -- System Information: Debian Release: wheezy/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing') Architecture: amd64 (x86_64) Kernel: Linux 3.2.0-2-amd64 (SMP w/6 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages xsensors depends on: ii libatk1.0-0 2.2.0-2 ii libc6 2.13-27 ii libcairo2 1.10.2-7 ii libfontconfig1 2.8.0-3.1 ii libfreetype6 2.4.8-1 ii libgdk-pixbuf2.0-0 2.24.1-1 ii libglib2.0-0 2.30.2-6 ii libgtk2.0-0 2.24.10-1 ii libpango1.0-0 1.29.4-3 ii libsensors4 1:3.3.1-2 Versions of packages xsensors recommends: ii lm-sensors 1:3.3.1-2 xsensors suggests no packages. -- no debconf information
From: John Vogel <[email protected]> Subject: Fix passing of command line to start_gui() from main() * Add gtk_parse_args() in main() so gtk std args are stripped before getopt(). * Add nargc and nargv to update arg vector for start_gui(). * Adjust arg parsing in start_gui(). --- diff -uNr a/src/gui.c b/src/gui.c --- a/src/gui.c 2012-03-24 08:38:28.247092369 -0400 +++ b/src/gui.c 2012-03-24 08:48:11.955097035 -0400 @@ -547,8 +547,8 @@ gtk_container_add( GTK_CONTAINER (mainwindow), notebook ); - if ( argc >= 2 ) { - for ( i = 1; i < argc; i++ ) { + if ( argc > 0 ) { + for ( i = 0; i < argc; i++ ) { head = add_sensor_chips( notebook, argv[i] ); if ( head == NULL ) return FAILURE; diff -uNr a/src/main.c b/src/main.c --- a/src/main.c 2012-03-24 08:38:28.247092368 -0400 +++ b/src/main.c 2012-03-24 08:45:23.539095688 -0400 @@ -61,6 +61,10 @@ char *sens_config = NULL; FILE *sens_conf_file = NULL; char *temp_str = NULL; + int nargc; + char **nargv; + + gtk_parse_args (&argc, &argv); /* Process arguements. */ while ( ( c = getopt( argc, argv, "fhc:i:t:v" ) ) != EOF ) { @@ -105,6 +109,9 @@ } } + nargc = argc - optind; + nargv = (char **)argv+optind; + /* Open the config file if specified. */ if ( sens_config && ( sens_conf_file = fopen( sens_config, "r" ) ) == NULL ) { @@ -122,7 +129,7 @@ } /* This will start the GUI. */ - if ( start_gui( argc, argv ) != SUCCESS ) { + if ( start_gui( nargc, nargv ) != SUCCESS ) { fprintf( stderr, "GUI failed!\n" ); }

