Skip to content

Commit

Permalink
QA: Another fix for #5915
Browse files Browse the repository at this point in the history
This should catch the failed INFO calls.
  • Loading branch information
TheWitness committed Nov 16, 2024
1 parent 988921c commit 955bec5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/rrd.php
Original file line number Diff line number Diff line change
Expand Up @@ -3041,6 +3041,14 @@ function rrdtool_function_info($local_data_id, $rrdtool_pipe = null) {
/* Get the path to rrdtool file */
$data_source_path = get_data_source_path($local_data_id, true);

if (read_config_option('storage_location')) {
if (!rrdtool_execute("file_exists $data_source_path", true, RRDTOOL_OUTPUT_BOOLEAN, $rrdtool_pipe, 'POLLER')) {
return false;
}
} elseif (!file_exists($data_source_path)) {
return false;
}

/* Execute rrdtool info command */
$cmd_line = ' info ' . $data_source_path;
$output = rrdtool_execute($cmd_line, RRDTOOL_OUTPUT_NULL, RRDTOOL_OUTPUT_STDOUT, $rrdtool_pipe);
Expand Down

0 comments on commit 955bec5

Please sign in to comment.