summaryrefslogtreecommitdiff
blob: ee2930622370e4ccbf37073de95ca1b649d2e329 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- durep       2007-09-08 11:44:05.000000000 -0500
+++ durep.new   2008-12-15 10:04:14.907825184 -0600
@@ -175,6 +175,7 @@
   my $coalesced_size = 0;
   my $node = {};
   my $temp;
+  my $dirhandle;

   $node->{ID} = $next_id++;
   if(defined $parent) {
@@ -196,9 +197,9 @@

   $node->{TYPE} &= $TYPE_COLLAPSED unless $store;

-  opendir(DIR, $dir) or warn "Unable to open dir '$dir': $!\n" and return $node;
+  opendir($dirhandle, $dir) or warn "Unable to open dir '$dir': $!\n" and return $node;

-  foreach(readdir(DIR)) {
+  foreach(readdir($dirhandle)) {
     @stats = lstat "$dir/$_" or warn "Unable to lstat '$dir/$_': $!\n" and next;

     $node->{MTIME} = $stats[9] if($_ eq ".");
@@ -247,7 +248,7 @@
     $file_count++;
     $node->{FCOUNT}++;
   }
-  closedir(DIR);
+  closedir($dirhandle);

   if($coalesced_count) {
     if($store) {