Skip to content

Commit

Permalink
- fix compilation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
steveschnepp committed Apr 11, 2012
1 parent 58e74c7 commit bca56ff
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions master/lib/Munin/Master/HTMLOld.pm
Expand Up @@ -153,18 +153,23 @@ sub get_config {
$htmlconfig = munin_readconfig_storable($htmlconfcache);
}
if(!defined $htmlconfig){
my $graphs_filename = $config->{dbdir} . "/graphs";
my $graphs_filename_tmp = $graphs_filename . ".tmp." . $$;

# If we are in a CGI html context, no graphing file dump !
unless ($ENV{SCRIPT_NAME}) {
my $graphs_filename = $config->{dbdir} . "/graphs";
my $graphs_filename_tmp = $graphs_filename . ".tmp." . $$;
$config->{"#%#graphs_fh"} = new IO::File("> $graphs_filename_tmp");
}

$htmlconfig = generate_config($config);
$config->{"#%#graphs_fh"} = undef;

# Atomic move
rename($graphs_filename_tmp, $graphs_filename);
unless ($ENV{SCRIPT_NAME}) {
# Closing the file
$config->{"#%#graphs_fh"} = undef;

# Atomic move
rename($graphs_filename_tmp, $graphs_filename);
}
}
return $htmlconfig;
}
Expand Down

0 comments on commit bca56ff

Please sign in to comment.