From: Alex Riesen Date: Wed, 27 Jun 2007 14:04:28 GMT Subject: Re: [PATCH] git-log: detect dup and fdopen failure Message-ID: <81b0412b0706270704y58c9e05bh6ec10118d7ee406c@mail.gmail.com> In-Reply-To: <87d4zho74h.fsf@rho.meyering.net> On 6/27/07, Jim Meyering wrote: > "Alex Riesen" 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? Are you sure fdopen on Cygwin sets ENOMEM? > > > > Kinda stuffed in here. What's wrong with plain > > 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 (which actually isn't a developers tool, but very common) will return. > > (Yes, I do think that "duplicate standard output" is useless, > > except for debugging. Exactly as strerror is, but that is shorter). > > I like to include *something* in the diagnostic so that when someone > sees it and reports it developers have an easier time finding where it > comes from in the code. Especially with something as unlikely (and hard > to reproduce) as this, that might be useful. Then put file name and the line number in!