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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:54:21

David Aguilar [off-list ref] 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?

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

From: David Aguilar <hidden>
Date: 2016-06-15 22:54:21

On Thu, Jul 26, 2012 at 12:07 PM, Junio C Hamano [off-list ref] wrote:
David Aguilar [off-list ref] writes:
quoted
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help