git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Don't call fstat() on stdin in index-pack.

From
Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
Date
Jan 19, 2007, 03:02 UTC
Message-ID
<45B034D2.6010007@fs.ei.tum.de>
In-Reply-To
<20070119024436.GQ8624@jukie.net>
Bart Trojanowski wrote:
Show 11 quoted lines
>  	/* 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   / \
Previous: Bart TrojanowskiNext: Sergey Vlasov
Message 3 of 6 in “git push problem with v1.5.0-rc1”
  1. Bart TrojanowskiJan 18, 2007
  2. Don't call fstat() on stdin in index-pack.Bart Trojanowski, Jan 19, 2007
  3. Simon 'corecode' SchubertJan 19, 2007
  4. Sergey VlasovJan 20, 2007
  5. Simon 'corecode' SchubertJan 20, 2007
  6. Bart TrojanowskiJan 19, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.