From: David Aguilar Date: Thu, 26 Jul 2012 19:25:12 GMT Subject: Re: [PATCH 2/2] difftool: Handle compare() returning -1 Message-ID: In-Reply-To: <7vd33i733s.fsf@alter.siamese.dyndns.org> On Thu, Jul 26, 2012 at 12:07 PM, Junio C Hamano wrote: > David Aguilar 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