Skip to content

Commit

Permalink
[Perl] Silence warnings of Module::ScanDeps for dynamic loaded modules.
Browse files Browse the repository at this point in the history
Fixes github issue #41 by @bxkx @r-lindner.
  • Loading branch information
liske committed Nov 3, 2016
1 parent b4df1f9 commit 493c2fc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ needrestart (2.10) unstable; urgency=medium
(github issue #46 by @jleroy @eigengrau)
* Fixes:
- [Core] Do not ignore processes if maps file could not be read.
- [Perl] Silence warnings of Module::ScanDeps for dynamic loaded modules.
(github issue #41 by @bxkx @r-lindner)

-- Thomas Liske <thomas@fiasko-nw.net>

Expand Down
14 changes: 10 additions & 4 deletions perl/lib/NeedRestart/Interp/Perl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,16 @@ sub files {
}

@Module::ScanDeps::IncludeLibs = (exists($opts{I}) ? ($opts{I}) : ());
my $href = scan_deps(
files => [$src],
recurse => 1,
);
my $href;
{
# Silence warnings of Module::ScanDeps for dynamic loaded modules (github issue #41)
local $SIG{__WARN__} = sub { };

$href = scan_deps(
files => [$src],
recurse => 1,
);
}

my %ret = map {
my $stat = nr_stat($href->{$_}->{file});
Expand Down

0 comments on commit 493c2fc

Please sign in to comment.