From owner-freebsd-ports Sun Oct 13 10: 0:10 2002 Delivered-To: freebsd-ports@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 16E7837B401 for ; Sun, 13 Oct 2002 10:00:05 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3294543E8A for ; Sun, 13 Oct 2002 10:00:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9DH04Co008002 for ; Sun, 13 Oct 2002 10:00:04 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9DH04Ip008001; Sun, 13 Oct 2002 10:00:04 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1FAD937B401 for ; Sun, 13 Oct 2002 09:56:33 -0700 (PDT) Received: from kazi.fit.vutbr.cz (kazi.fit.vutbr.cz [147.229.8.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79EF543E7B for ; Sun, 13 Oct 2002 09:56:31 -0700 (PDT) (envelope-from cejkar@fit.vutbr.cz) Received: from kazi.fit.vutbr.cz (localhost [127.0.0.1]) by kazi.fit.vutbr.cz (8.12.6/8.12.6) with ESMTP id g9DGuRXk011415 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 13 Oct 2002 18:56:27 +0200 (CEST) Received: (from cejkar@localhost) by kazi.fit.vutbr.cz (8.12.6/8.12.5/Submit) id g9DGuRlW011414; Sun, 13 Oct 2002 18:56:27 +0200 (CEST) Message-Id: <200210131656.g9DGuRlW011414@kazi.fit.vutbr.cz> Date: Sun, 13 Oct 2002 18:56:27 +0200 (CEST) From: Cejka Rudolf Reply-To: Cejka Rudolf To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/44015: net/xferstats upgrade to version 2.16 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 44015 >Category: ports >Synopsis: net/xferstats upgrade to version 2.16 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Oct 13 10:00:03 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Rudolf Cejka >Release: FreeBSD 4.6-STABLE i386 >Organization: FIT, Brno University of Technology, Czech Republic >Environment: >Description: Here are the patches: -- cut here - Makefile patch: --- Makefile.orig Sun Oct 13 17:01:17 2002 +++ Makefile Sun Oct 13 17:02:24 2002 @@ -6,14 +6,12 @@ # PORTNAME= xferstats -PORTVERSION= 2.14 +PORTVERSION= 2.16 CATEGORIES= net MASTER_SITES= ftp://ftp.wu-ftpd.org/pub/support/ \ ftp://ftp.gpad.ac.ru/pub/FreeBSD/distfiles/ MAINTAINER= demon@FreeBSD.org - -WRKSRC= ${WRKDIR}/xferstats USE_GNOMENG= yes USE_GNOME= glib12 -- cut here -- cut here - distinfo patch: --- distinfo.orig Sun Oct 13 17:01:21 2002 +++ distinfo Sun Oct 13 17:01:54 2002 @@ -1 +1 @@ -MD5 (xferstats-2.14.tar.gz) = a14bad5dd5acafd615c3fc49a2f4899f +MD5 (xferstats-2.16.tar.gz) = d3281d6eeef8d04856a17f6d05c326a2 -- cut here And now patches similar to patches for version 2.14: patch-aa: If you use CHUNK_INPUT without this patch, you end up with many error messages xferstats in free(): warning: modified (chunk-) pointer (or you may want to fix chunks...) patch-ab: If number of "Files Transmitted" is divisible by CHUNK_INPUT without this patch, you end up with error "No data to process." instead of results. patch-ac: Typical beginner's bug in C: feof() is used before read function, where its result is not tested then. Without this patch the last line is counted twice. -- cut here - patch-aa: --- xferstats.x Thu Jan 11 19:35:18 2001 +++ xferstats.h Thu Jan 11 19:35:52 2001 @@ -39,6 +39,7 @@ /* glibc's malloc is so damn efficient, chunks actually slow it down. so only * use g_mem_chunks on non-glibc systems */ +#define __GLIBC__ #ifdef __GLIBC__ # define G_MEM_CHUNK_ALLOC(bar) g_malloc(bar) # define G_MEM_CHUNK_ALLOC0(bar) g_malloc0(bar) -- cut here -- cut here - patch-ab: --- xferstats.x Thu Jan 11 19:49:22 2001 +++ xferstats.c Thu Jan 11 19:50:31 2001 @@ -2486,6 +2486,7 @@ { pointers_t * pointers; char * default_logfile; + int first = 1; /* unbuffer stdout and stderr so output isn't lost */ setbuf(stdout, NULL); @@ -2559,10 +2560,11 @@ G_BLOW_CHUNKS(); - if (!pointers->first_ftp_line) { + if (first && !pointers->first_ftp_line) { fprintf(stderr, "No data to process.\n"); exit(0); } + first = 0; generate_daily_data(pointers, pointers->first_ftp_line); if (pointers->config->dow_traffic) -- cut here -- cut here - patch-ac: --- parselog.c.orig Sun Oct 13 17:39:55 2002 +++ parselog.c Sun Oct 13 17:42:12 2002 @@ -202,15 +202,11 @@ while (1) { if (pointers->config->use_stdin) { - if (feof(stdin)) + if (fgets(foo, sizeof(foo), stdin) == NULL) break; - /* there's probably a better way to do this :) */ - fgets(foo, sizeof(foo), stdin); } else { - if (feof(log_stream)) + if (fgets(foo, sizeof(foo), log_stream) == NULL) break; - - fgets(foo, sizeof(foo), log_stream); } if ((len = strlen(foo)) < 42) @@ -455,10 +451,8 @@ #ifdef HAVE_MMAP if (pointers->config->use_stdin) { - if (feof(stdin)) + if (fgets(foo, sizeof(foo), stdin) == NULL) break; - /* there's probably a better way to do this :) */ - fgets(foo, sizeof(foo), stdin); } else { @@ -497,17 +491,13 @@ #else /* HAVE_MMAP */ if (pointers->config->use_stdin) { - if (feof(stdin)) + if (fgets(foo, sizeof(foo), stdin) == NULL) break; - /* there's probably a better way to do this :) */ - fgets(foo, sizeof(foo), stdin); } else { - if (feof(log_stream)) + if (fgets(foo, sizeof(foo), log_stream) == NULL) break; - - fgets(foo, sizeof(foo), log_stream); } #endif /* HAVE_MMAP */ @@ -770,10 +760,8 @@ #ifdef HAVE_MMAP if (pointers->config->use_stdin) { - if (feof(stdin)) + if (fgets(foo, sizeof(foo), stdin) == NULL) break; - /* there's probably a better way to do this :) */ - fgets(foo, 2047, stdin); } else { @@ -812,17 +800,13 @@ #else /* HAVE_MMAP */ if (pointers->config->use_stdin) { - if (feof(stdin)) + if (fgets(foo, sizeof(foo), stdin) == NULL) break; - /* there's probably a better way to do this :) */ - fgets(foo, 2047, stdin); } else { - if (feof(log_stream)) + if (fgets(foo, sizeof(foo), log_stream) == NULL) break; - - fgets(foo, sizeof(foo), log_stream); } #endif /* HAVE_MMAP */ -- cut here >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message