From owner-freebsd-stable Tue Aug 20 5:27: 2 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 57FDA37B400 for ; Tue, 20 Aug 2002 05:26:56 -0700 (PDT) Received: from mta02ps.bigpond.com (mta02ps.bigpond.com [144.135.25.134]) by mx1.FreeBSD.org (Postfix) with ESMTP id 795E543E65 for ; Tue, 20 Aug 2002 05:26:54 -0700 (PDT) (envelope-from areilly@bigpond.net.au) Received: from areilly.bpc-users.org ([144.135.25.69]) by mta02ps.bigpond.com (Netscape Messaging Server 4.15 mta02ps May 23 2002 23:53:28) with SMTP id H156E500.2VZ for ; Tue, 20 Aug 2002 22:22:53 +1000 Received: from CPE-144-132-188-183.nsw.bigpond.net.au ([144.132.188.183]) by PSMAM01.mailsvc.email.bigpond.com(MailRouter V3.0n 71/2444545); 20 Aug 2002 22:22:53 Received: (qmail 27359 invoked from network); 20 Aug 2002 12:22:55 -0000 Received: from localhost (andrew@127.0.0.1) by localhost with SMTP; 20 Aug 2002 12:22:55 -0000 Subject: Re: A but in Zoo From: Andrew Reilly To: Erik Trulsson Cc: Bill Vermillion , stable@FreeBSD.ORG, ports@FreeBSD.ORG In-Reply-To: <20020814130031.GA58489@falcon.midgard.homeip.net> References: <20020814114442.GA77130@wjv.com> <20020814130031.GA58489@falcon.midgard.homeip.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 20 Aug 2002 22:22:55 +1000 Message-Id: <1029846175.26839.25.camel@gurney.reilly.home> Mime-Version: 1.0 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 2002-08-14 at 23:00, Erik Trulsson wrote: > A quick investigation indicates that this is a bug in zoo. > It presumably was not exposed on earlier versions of FreeBSD. > To be more precise the function zootrunc() which can be found at the > end of the file bsd.c contains a line > > seekpos = lseek(fd, 0L, SEEK_CUR); > > This should be changed to > > seekpos = lseek(fd, (off_t) 0L, SEEK_CUR); Rather than changing the source like this, wouldn't it be much better, more portable and above all neater just to make sure that the prototype for lseek() was in scope at that point, so that the 0L could be promoted automatically and correctly by the compiler? (I.e., #include somewhere above.) In fact, with the prototype in scope, I'd be tempted to change the 2nd arg from 0L to just 0, and be done with it. Hmm. Looking at the header files just now, it seems that the declaration of lseek is conditional on a symbol _LSEEK_DECLARED, which is defined in both unistd.h and stdio.h (where it is, in turn, conditional on _ANSI_SOURCE and _POSIX_SOURCE). -- Andrew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message