changeset 13335:a8b9fb2737b8

754 Build of illumos-gate fails with perl-5.10.0 as default perl Reviewed by: Gordon Ross <gordon.w.ross@gmail.com> Reviewed by: Albert Lee <trisk@opensolaris.org> Approved by: Garrett D'Amore <garrett@nexenta.com>
author Richard Lowe <richlowe@richlowe.net>
date Thu, 07 Apr 2011 21:19:00 -0400
parents 90920e3f9201
children 194dde734096
files usr/src/tools/scripts/find_elf.pl
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/tools/scripts/find_elf.pl	Tue Mar 29 22:27:20 2011 +0000
+++ b/usr/src/tools/scripts/find_elf.pl	Thu Apr 07 21:19:00 2011 -0400
@@ -56,6 +56,7 @@
 use POSIX qw(getenv);
 use Getopt::Std;
 use File::Basename;
+use IO::Dir;
 
 
 ## GetObjectInfo(path)
@@ -232,8 +233,9 @@
 	my($NewFull, $NewRel, $Entry);
 
 	# Open the directory and read each entry, omit files starting with "."
-	if (opendir(DIR, $FullDir)) {
-		foreach $Entry (readdir(DIR)) {
+	my $Dir = IO::Dir->new($FullDir);
+	if (defined($Dir)) {
+		foreach $Entry ($Dir->read()) {
 
 			# In fast mode, we skip any file name that starts
 			# with a dot, which by side effect also skips the
@@ -300,7 +302,7 @@
 			}
 
 		}
-		closedir(DIR);
+		$Dir->close();
 	}
 }