diff options
author | Niels Thykier <niels@thykier.net> | 2016-01-04 21:42:29 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2016-01-04 21:42:29 +0000 |
commit | 240bc401f2202744654d472a13ddbd73e0c733cc (patch) | |
tree | 0367c28a601b2137ceda49a0986c7035390ab60b | |
parent | df52ff1efcb059579106f9f1fa3233708b5c657a (diff) | |
download | debhelper-240bc401f2202744654d472a13ddbd73e0c733cc.tar.gz |
dh_icons: Add missing error check and close
Signed-off-by: Niels Thykier <niels@thykier.net>
-rwxr-xr-x | dh_icons | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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"); |