[debhelper-devel] [debhelper] 01/01: dh_icons: Add missing error check and close

Niels Thykier nthykier at moszumanska.debian.org
Mon Jan 4 21:42:42 UTC 2016


This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository debhelper.

commit 240bc401f2202744654d472a13ddbd73e0c733cc
Author: Niels Thykier <niels at thykier.net>
Date:   Mon Jan 4 21:42:29 2016 +0000

    dh_icons: Add missing error check and close
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 dh_icons | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dh_icons b/dh_icons
index dd305f5..b6caaf3 100755
--- a/dh_icons
+++ b/dh_icons
@@ -50,8 +50,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 	my $icondir="$tmp$baseicondir";
 	if (-d $icondir) {
 		my @dirlist;
-		opendir(DIRHANDLE, $icondir);
-		while (my $subdir = readdir(DIRHANDLE)) {
+		opendir(my $dirfd, $icondir) or error("Cannot opendir($icondir): $!");
+		while (my $subdir = readdir($dirfd)) {
 			next if $subdir =~ /^\./;
 			next if $subdir eq "gnome";
 			next if $subdir eq "hicolor";
@@ -61,6 +61,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 			}, "$icondir/$subdir" ;
 			push @dirlist, "$baseicondir/$subdir" if $needs_cache;
 		}
+		closedir($dirfd);
 		if (@dirlist and ! $dh{NOSCRIPTS}) {
 			my $list=join(" ", sort @dirlist);
 			autoscript($package,"postinst","postinst-icons","s%#DIRLIST#%$list%g");

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git




More information about the debhelper-devel mailing list