From owner-cvs-all Tue Mar 27 23:45: 3 2001 Delivered-To: cvs-all@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id 2F45A37B719; Tue, 27 Mar 2001 23:44:58 -0800 (PST) (envelope-from dwmalone@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 28 Mar 2001 08:44:57 +0100 (BST) Date: Wed, 28 Mar 2001 08:44:57 +0100 From: David Malone To: "Andrey A. Chernov" Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/tail forward.c Message-ID: <20010328084457.A91235@walton.maths.tcd.ie> References: <200103272324.f2RNOQc56458@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200103272324.f2RNOQc56458@freefall.freebsd.org>; from ache@FreeBSD.org on Tue, Mar 27, 2001 at 03:24:26PM -0800 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Mar 27, 2001 at 03:24:26PM -0800, Andrey A. Chernov wrote: > Restore part of my fix spammed in v1.23: I actually discussed this with Ian before committing, so spammed is a bit strong. ;-) > fseeko(file_size, SEEK_SET) -> fseek(0L, SEEK_END) > 1) File may grows between operations, so fseeko to file_size may miss > 2) 0L, SEEK_END is the same code using in tail in all other places The problem is that you only want to seek to the end of the data you have already displayed, not to the end of the file. Otherwise if you are using "tail -f" and the file grows between the original stat and the fseek you will not print the data in between. Can you confirm that fseeko(file_size, SEEK_SET) is actually correct? David. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message