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

Re: [PATCH 2/2] difftool: Handle compare() returning -1

From
David Aguilar <davvid@gmail.com>
Date
Jul 26, 2012, 19:25 UTC
Message-ID
<CAJDDKr7xRL_bXOs5Ka2g9v=_AVpr7vzt3fd-5DYtiF_4gLE7QQ@mail.gmail.com>
In-Reply-To
<7vd33i733s.fsf@alter.siamese.dyndns.org>
On Thu, Jul 26, 2012 at 12:07 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
> David Aguilar <davvid@gmail.com> writes:
>
>> +sub exit_cleanup
>> +{
>> +     my ($tmpdir, $status) = @_;
>> +     rmtree($tmpdir);
>> +     if ($status and $!) {
>> +             my ($package, $file, $line) = caller();
>> +             warn "$file line $line: $!\n";
>
> Are you sure rmtree() would not clobber $! before the code checks it
> here?

rmtree() calls croak() on fatal error, but it would certainly be clearer and safer to store $! before calling rmtree.

-- 
David
Previous: Junio C Hamano
Message 4 of 4 in “difftool: Wrap long lines for readability”
  1. 1/2 difftool: Wrap long lines for readabilityDavid Aguilar, Jul 26, 2012
  2. 2/2 difftool: Handle compare() returning -1David Aguilar, Jul 26, 2012
  3. Junio C HamanoJul 26, 2012
  4. David AguilarJul 26, 2012

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.