From: Chip Salzenberg Date: Wed, 4 Mar 1998 01:04:37 +0000 (+0000) Subject: [win32] sync maintpatch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=94d4f21ce5099f301ed168bfe5ebf5e185d03459;p=p5sagit%2Fp5-mst-13.2.git [win32] sync maintpatch #76: "Fix infinite loop on unlink() failure in File::Path::rmtree() Files: lib/File/Path.pm p4raw-id: //depot/win32/perl@723 --- diff --git a/lib/File/Path.pm b/lib/File/Path.pm index 492f150..6b5d568 100644 --- a/lib/File/Path.pm +++ b/lib/File/Path.pm @@ -92,7 +92,7 @@ Charles Bailey > =head1 REVISION -Current $VERSION is 1.04. +Current $VERSION is 1.0401. =cut @@ -103,7 +103,7 @@ use Exporter (); use strict; use vars qw( $VERSION @ISA @EXPORT ); -$VERSION = "1.04"; +$VERSION = "1.0401"; @ISA = qw( Exporter ); @EXPORT = qw( mkpath rmtree ); @@ -202,18 +202,18 @@ sub rmtree { if $force_writeable; print "unlink $root\n" if $verbose; # delete all versions under VMS - while (-e $root || -l $root) { - if (unlink $root) { - ++$count; - } - else { + for (;;) { + unless (unlink $root) { carp "Can't unlink file $root: $!"; if ($force_writeable) { chmod $rp, $root or carp("and can't restore permissions to " . sprintf("0%o",$rp) . "\n"); } + last; } + ++$count; + last unless $Is_VMS && lstat $root; } } }