Skip to content

Commit

Permalink
defer failing unlink0
Browse files Browse the repository at this point in the history
Addresses https://rt.cpan.org/Ticket/Display.html?id=82720

On NFS, unlink0 fails.  Instead of croaking, we now defer unlinking
so that it becomes a warning instead of fatal, just like for
operating systems that don't support unlink0.
  • Loading branch information
xdg committed Feb 6, 2013
1 parent e0fd599 commit 3f836f8
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/File/Temp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2008,15 +2008,14 @@ sub unlink0 {
# Make sure that the link count is zero
# - Cygwin provides deferred unlinking, however,
# on Win9x the link count remains 1
# On NFS the link count may still be 1 but we cant know that
# we are on NFS
return ( $fh[3] == 0 or $^O eq 'cygwin' ? 1 : 0);
# On NFS the link count may still be 1 but we can't know that
# we are on NFS. Since we can't be sure, we'll defer it

} else {
_deferred_unlink($fh, $path, 0);
return 1;
return 1 if $fh[3] == 0 || $^O eq 'cygwin';
}

# fall-through if we can't unlink now
_deferred_unlink($fh, $path, 0);
return 1;
}

=item B<cmpstat>
Expand Down

0 comments on commit 3f836f8

Please sign in to comment.