On Thu, Jul 26, 2012 at 12:07 PM, Junio C Hamano <gits...@pobox.com> wrote:
> David Aguilar <dav...@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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to