Mail Archives: cygwin/2003/07/29/11:49:41
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 <stdio.h>
+#include <unistd.h>
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/
- Raw text -