Skip to content

Commit

Permalink
Fix perl warning while scanning dangling kernel symlinks (github issue
Browse files Browse the repository at this point in the history
…#6 by Elan Ruusamäe [@glensc]).
  • Loading branch information
liske committed Apr 14, 2015
1 parent 6c3d992 commit 601ab27
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions perl/lib/NeedRestart/Kernel/Linux.pm
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ sub nr_kernel_check_real($$) {
$ui->progress_step;
my $stat = nr_stat($fn);

unless(defined($stat)) {
print STDERR "$LOGPREF could not stat(2) on $fn\n" if($debug);
next;
}

if($stat->{size} < 1000000) {
print STDERR "$LOGPREF $fn seems to be too small\n" if($debug);
next;
Expand Down
5 changes: 5 additions & 0 deletions perl/lib/NeedRestart/Kernel/kFreeBSD.pm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ sub nr_kernel_check_real($$) {
$ui->progress_step;
my $stat = nr_stat($fn);

unless(defined($stat)) {
print STDERR "$LOGPREF could not stat(2) on $fn\n" if($debug);
next;
}

if($stat->{size} < 1000000) {
print STDERR "$LOGPREF $fn seems to be too small\n" if($debug);
next;
Expand Down

0 comments on commit 601ab27

Please sign in to comment.