Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Tue, 29 Jul 2003 11:49:25 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: 1.5.1: lseek64 woes (was Re: 1.5.1: unzip problems with binary files in archive) Message-ID: <20030729154925.GA16588@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <16165 DOT 33853 DOT 968862 DOT 592625 AT phish DOT entomo DOT com> <20030729011247 DOT GB3099 AT redhat DOT com> <3F25CACF DOT 945DCBED AT acm DOT org> <20030729011846 DOT GC3099 AT redhat DOT com> <3F25F644 DOT 2090202 AT cwilson DOT fastmail DOT fm> <16166 DOT 5927 DOT 665592 DOT 841970 AT gargle DOT gargle DOT HOWL> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16166.5927.665592.841970@gargle.gargle.HOWL> User-Agent: Mutt/1.4.1i On Mon, Jul 28, 2003 at 11:41:43PM -0700, David Rothenberger wrote: Content-Description: message body text >Charles Wilson writes: > > Christopher Faylor wrote: > > > > >>>>I'm getting a strange error from unzip when trying to extract an > > >>>>archive that contains binary files. Everything works fine if the > > >>>>archive contains just text files. > > >>> > > >>>Can't duplicate it. Sorry. > > >> > > I --can-- duplicate it. But I don't know why it happens; I'll have to > > debug it...but not until after I update to 1.5.1. FWIW, zip does use > > fdopen(). > >I've done some debugging and I have a STC. I have no idea why it >fails, and why Chris doesn't see it, but here's the info. > >The STC is composed of the two attached files: works.c and fails.c. >Both files essentially do > > int fd = open("works.c", 0); > lseek(fd, 1, 0); > >but works.c does this directly in main(), while fails.c does this in >unzip() called from main(). As you can guess, lseek() returns -1 in >fails.c and 1 in works.c. And here's why "fails.c" fails: --- lseek-fails.c~ 2003-07-29 11:43:29.428769079 -0400 +++ lseek-fails.c 2003-07-29 11:46:01.911652780 -0400 @@ -1,4 +1,5 @@ #include +#include void unzip() { You need to include the prototype for lseek. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/