summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a203c3f)
raw | patch | inline | side by side (parent: a203c3f)
author | Sebastian Harl <sh@tokkee.org> | |
Fri, 5 Oct 2007 17:37:38 +0000 (19:37 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Fri, 5 Oct 2007 17:37:38 +0000 (19:37 +0200) |
If open{,dir}() fails, the {file,dir}handle is _not_ an undefined value.
The functions simply return a false value in that case.
The functions simply return a false value in that case.
debian/check_plugins.pl | patch | blob | history |
index c173aeeab3db9ee44d31c783f421b6cfb53c7e08..eac3b5d9b53a4811f5bda9e6cd6ba18d7f818436 100755 (executable)
--- a/debian/check_plugins.pl
+++ b/debian/check_plugins.pl
my $plugins = {};
-opendir(my $srcs, $srcdir);
+my ($srcs, $libs) = (undef, undef);
-if (! $srcs) {
+if (! opendir($srcs, $srcdir)) {
print STDERR "Could not open directory '$srcdir': $!\n"
. "Make sure you are in the toplevel source directory.\n";
exit 1;
}
my $name = $1;
+ my $src = undef;
- open(my $src, "<", "$srcdir/$dirent");
-
- if (! $src) {
+ if (! open($src, "<", "$srcdir/$dirent")) {
print STDERR "Unable to open '$srcdir/$dirent': $!\n";
next;
}
closedir($srcs);
-opendir(my $libs, $libdir);
-
-if (! $libs) {
+if (! opendir($libs, $libdir)) {
print STDERR "Could not open directory '$libdir': $!\n"
. "Make sure you ran 'make'.\n";
exit 1;
}
my $name = $1;
+ my $nm = undef;
if (! defined $plugins->{$name}) {
print STDERR "No information available for plugin '$name'!\n";
next;
}
- open(my $nm, "-|", "nm $libdir/$dirent");
-
- if (! $nm) {
+ if (! open($nm, "-|", "nm $libdir/$dirent")) {
print STDERR "Unable to open pipe from nm(1): $!\n";
next;
}