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

Re: [PATCH] git-log: detect dup and fdopen failure

From
Alex Riesen <raa.lkml@gmail.com>
Date
Jun 27, 2007, 15:57 UTC
Message-ID
<81b0412b0706270857w175f2b2ey4c30bac9c0836929@mail.gmail.com>
In-Reply-To
<87tzstmqmi.fsf@rho.meyering.net>
On 6/27/07, Jim Meyering <jim@meyering.net> wrote:
Show 14 quoted lines
> "Alex Riesen" <raa.lkml@gmail.com> wrote:
>
> > On 6/27/07, Jim Meyering <jim@meyering.net> wrote:
> >> "Alex Riesen" <raa.lkml@gmail.com> wrote:
> >> > Check if this works in some exotic but common
> >> > environments (like MacOSX, Cygwin or HP-UX).
> >>
> >> What do you mean?
> >> I know that dup and fdopen work in those environments.
> >
> > Exactly as you described?
>
> No, but why does that matter?
>

Your code will need additional tweaking on this systems.

Show 5 quoted lines
> > Are you sure fdopen on Cygwin
> > sets ENOMEM?
>
> Are you suggesting not to use errno because
> it won't contain useful information on Mingw32?
Yes. Mingw32 is just one example.
Show 7 quoted lines
> >> It's ok, but for the fact that when dup fails, all you get
> >> is the uninformative EINVAL from fdopen.
> >
> > EBADF on Cygwin, 0 on Mingw32. Can't even imagine what msvc
>
> EBADF is fine.  Setting errno to 0 upon error is a bug.
> Don't cater to buggy systems.
It is my system at work. What should I do, throw it out of window?
> >
> > Then put file name and the line number in!
>
> Surely you're playing devil's advocate, now...

No, I'm just thinking aloud about whether I should start preparing a reverting commit for your changes just to be able to continue using Git on that mismanaged, stupid, slow and very real system I have to work with. It is a Win2k laptop, in a Novell network and with Cygwin on (actually 2 cygwins at least, which cygwin does not support), and without a chance to _EVER_ use anything else. And I happen to depend on Git, because the alternative is, as someone noted, "badly mismanaged" Perforce. And I believe I am not that bad off, there are other systems on which you didn't test either. "Silly", as you say.

Previous: Jim MeyeringNext: Jim Meyering
Message 8 of 15 in “detect dup failure”
  1. detect dup failureJim Meyering, Jun 27, 2007
  2. Alex RiesenJun 27, 2007
  3. git-log: detect dup and fdopen failureJim Meyering, Jun 27, 2007
  4. Alex RiesenJun 27, 2007
  5. Jim MeyeringJun 27, 2007
  6. Alex RiesenJun 27, 2007
  7. Jim MeyeringJun 27, 2007
  8. Alex RiesenJun 27, 2007
  9. Jim MeyeringJun 27, 2007
  10. Geert BoschJun 27, 2007
  11. Jim MeyeringJun 27, 2007
  12. Jim MeyeringJun 27, 2007
  13. Linus TorvaldsJun 27, 2007
  14. Josh TriplettJun 28, 2007
  15. Shawn O. PearceJun 28, 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.