summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-03-31 17:46:49 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-03-31 17:47:06 +0200
commit3e95ef30eee0176244b04dba8e394c95a1adadd2 (patch)
treef85b28613caa35291c23818a4afd464ad57e1d67 /bin
parent62e6032908c0935752bb8258349691cf8985d7b4 (diff)
checklinks: Minor code cleanup number UINT32_MAX (or so)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/checklinks14
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/checklinks b/bin/checklinks
index af0357c..289f438 100755
--- a/bin/checklinks
+++ b/bin/checklinks
@@ -25,8 +25,8 @@ sub mkdirs {
# the last element is the file
pop(@dirs);
- foreach(@dirs) {
- unless(-d "$path/$_") {
+ foreach (@dirs) {
+ if (not -d "$path/$_") {
mkdir("$path/$_") or die("Can't create $path/$_: $!");
}
$path .= $_;
@@ -45,10 +45,10 @@ sub dir_content {
push(@return, $entry);
- if (!$dot_file and $entry =~ /^\./) {
+ if (not $dot_file and $entry =~ /^\./) {
$dot_file = 1;
}
- elsif (!$normal_file) {
+ elsif (not $normal_file) {
$normal_file = 1
}
}
@@ -195,7 +195,7 @@ else {
exit(0);
}
-open(my $links, '<', $linkfile) or die("Can't open $linkfile: $!");
+open(my $links, '<', $linkfile) or die("Cannot open $linkfile: $!");
while (my $line = <$links>) {
chomp($line);
@@ -205,7 +205,7 @@ while (my $line = <$links>) {
my ($type, $src, $dst) = split(/\s+/, $line);
- next unless ($type ~~ ['soft', 'hard', 'auto']);
+ next if (not($type ~~ ['soft', 'hard', 'auto']));
if ($type eq 'auto') {
loop_links();
@@ -222,7 +222,7 @@ while (my $line = <$links>) {
}
}
}
-close($links);
+close($links) or die("Cannot close $linkfile: $!");
exit($exit);