mirror of https://github.com/mikaku/Monitorix.git
fixed to use closedir() instead close() when closing directories
This commit is contained in:
parent
1cb217a92a
commit
02eb4fb837
|
@ -480,7 +480,7 @@ if($options{d}) {
|
||||||
# load additional configuration files
|
# load additional configuration files
|
||||||
if($config{include_dir} && opendir(DIR, $config{include_dir})) {
|
if($config{include_dir} && opendir(DIR, $config{include_dir})) {
|
||||||
my @files = grep { !/^[.]/ } readdir(DIR);
|
my @files = grep { !/^[.]/ } readdir(DIR);
|
||||||
close(DIR);
|
closedir(DIR);
|
||||||
foreach my $c (sort @files) {
|
foreach my $c (sort @files) {
|
||||||
next unless -f $config{include_dir} . "/$c";
|
next unless -f $config{include_dir} . "/$c";
|
||||||
next unless $c =~ m/\.conf$/;
|
next unless $c =~ m/\.conf$/;
|
||||||
|
|
|
@ -219,7 +219,7 @@ my $conf = new Config::General(
|
||||||
# load additional configuration files
|
# load additional configuration files
|
||||||
if($config{include_dir} && opendir(DIR, $config{include_dir})) {
|
if($config{include_dir} && opendir(DIR, $config{include_dir})) {
|
||||||
my @files = grep { !/^[.]/ } readdir(DIR);
|
my @files = grep { !/^[.]/ } readdir(DIR);
|
||||||
close(DIR);
|
closedir(DIR);
|
||||||
foreach my $c (sort @files) {
|
foreach my $c (sort @files) {
|
||||||
next unless -f $config{include_dir} . "/$c";
|
next unless -f $config{include_dir} . "/$c";
|
||||||
next unless $c =~ m/\.conf$/;
|
next unless $c =~ m/\.conf$/;
|
||||||
|
|
Loading…
Reference in New Issue