Date: Wed, 30 Aug 2006 01:39:13 +0300 From: "Alex Samorukov" <samm@os2.kiev.ua> To: "FreeBSD gnats submit" <FreeBSD-gnats-submit@FreeBSD.org> Subject: ports/102665: www/sarg progress indicator broken Message-ID: <1156891153.9204@samm.local> Resent-Message-ID: <200608292240.k7TMeETd019870@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 102665 >Category: ports >Synopsis: www/sarg progress indicator broken >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Aug 29 22:40:14 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Alex Samorukov >Release: FreeBSD 6.1-RELEASE i386 >Organization: Shevchenko Didkovskiy and Partners >Environment: System: FreeBSD 6.1-RELEASE #2: Wed May 17 22:22:18 EEST 2006 root@samm.local:/usr/obj/usr/src/sys/SAMMKRNL >Description: When running sarg 2.2.2 i get garbage instead off progress indicator: SARG: Records in file: 645549, reading: -272893874588218345799594564781958471725SARG: Records in file: 645549, reading: -272893874588218345799594564781958471725 The problem is caused by the incorrect modifier for the off_t variable. log.c use %d (int), when freebsd use "long long" type, so next value is corrupted. I created separate bugreport at the http://sourceforge.net/tracker/index.php?func=detail&aid=1548911&group_id=68910&atid=522791, which fix this problem. >How-To-Repeat: Install, configure and run sarg. Progress indicator will be broken. After proposed patch progress indicator will work as designed. >Fix: diff --new-file -u -r sarg/files/patch-log.c sarg.new/files/patch-log.c --- sarg/files/patch-log.c Thu Jan 1 03:00:00 1970 +++ sarg.new/files/patch-log.c Wed Aug 30 01:36:08 2006 @@ -0,0 +1,30 @@ +diff -u -r sarg/work/sarg-2.2.2/log.c sarg.new/work/sarg-2.2.2/log.c +--- log.c Tue Aug 29 14:09:32 2006 ++++ log.c Wed Aug 30 01:34:18 2006 +@@ -772,7 +772,7 @@ + while( fgets(bufz,sizeof(bufz),fp_in) != NULL ) recs1++; + rewind(fp_in); + +- printf("SARG: Records in file: %d, reading: %3.2f%%\r",recs1,(float) 0); ++ printf("SARG: Records in file: %lli, reading: %3.2f%%\r",recs1,(float) 0); + fflush( stdout ) ; + } + +@@ -781,7 +781,7 @@ + if( bool_ShowReadStatistics && ! --OutputNonZero) { + perc = recs2 * 100 ; + perc = perc / recs1 ; +- printf("SARG: Records in file: %d, reading: %3.2f%%\r",recs1,perc); ++ printf("SARG: Records in file: %lli, reading: %3.2f%%\r",recs1,perc); + fflush (stdout); + OutputNonZero = REPORT_EVERY_X_LINES ; + } +@@ -1267,7 +1267,7 @@ + } + } + if( bool_ShowReadStatistics ) +- printf("SARG: Records in file: %d, reading: %3.2f%%\n",recs1, (float) 100 ); ++ printf("SARG: Records in file: %lli, reading: %3.2f%%\n",recs1, (float) 100 ); + } + + if ( fp_Download_Unsort ) >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1156891153.9204>