public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Simon 'corecode' Schubert <corecode@fs•ei.tum.de>
To: Bart Trojanowski <bart@jukie•net>
Cc: git@vger•kernel.org
Subject: Re: [PATCH] Don't call fstat() on stdin in index-pack.
Date: Fri, 19 Jan 2007 04:02:42 +0100	[thread overview]
Message-ID: <45B034D2.6010007@fs.ei.tum.de> (raw)
In-Reply-To: <20070119024436.GQ8624@jukie.net>

[-- Attachment #1: Type: text/plain, Size: 1371 bytes --]

Bart Trojanowski wrote:
>  	/* If input_fd is a file, we should have reached its end now. */
> -	if (fstat(input_fd, &st))
> -		die("cannot fstat packfile: %s", strerror(errno));
> -	if (S_ISREG(st.st_mode) && st.st_size != consumed_bytes)
> -		die("pack has junk at the end");
> +        if (input_fd) {
> +                if (fstat(input_fd, &st))
> +                        die("cannot fstat packfile: %s", strerror(errno));
> +                if (S_ISREG(st.st_mode) && st.st_size != consumed_bytes)
> +                        die("pack has junk at the end");
> +        }

This is clearly the wrong fix.  input_fd being 0 doesn't mean that it is *not* a regular file.  Only doing a fstat can tell.  You are simply hiding your real issue there, which is that you can't fstat on a pipe or whatever input_fd is.

The problem here is that your 64bit kernel can't fit the data into your struct stat provided by your 32bit libc.  Not a problem of git.  However, it would be interesting to know what exactly produces the EOVERFLOW.

cheers
  simon

-- 
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

  reply	other threads:[~2007-01-19  3:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-18 21:26 git push problem with v1.5.0-rc1 Bart Trojanowski
2007-01-19  2:44 ` [PATCH] Don't call fstat() on stdin in index-pack Bart Trojanowski
2007-01-19  3:02   ` Simon 'corecode' Schubert [this message]
2007-01-20 15:35     ` Sergey Vlasov
2007-01-20 18:00       ` Simon 'corecode' Schubert
2007-01-19  3:16 ` git push problem with v1.5.0-rc1 Bart Trojanowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45B034D2.6010007@fs.ei.tum.de \
    --to=corecode@fs$(echo .)ei.tum.de \
    --cc=bart@jukie$(echo .)net \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox