From 5dd242eff6de2d320c75ec83e5f988cd7c769cea Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sun, 19 Jul 2020 17:09:06 +0200 Subject: [PATCH] don't error out if the graph doesn't exist but can be created --- classes/rrdstat.php-class | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/rrdstat.php-class b/classes/rrdstat.php-class index 9226d56..0a71f13 100644 --- a/classes/rrdstat.php-class +++ b/classes/rrdstat.php-class @@ -760,7 +760,8 @@ class rrdstat { } $graph_cmd = $this->rrdtool_bin.' graph '.str_replace('*', '\*', $fname.$gOpts.$gDefs.$gGraphs.$addSpecial); - if (!is_writable($fname)) { + if ((file_exists($fname) && !is_writable($fname)) || + (!file_exists($fname) && !is_writable(dirname($fname)))) { trigger_error($this->rrd_file.' - graph file not writable: '.$fname, E_USER_WARNING); return 'command:'.$graph_cmd."\n\n".'unwritable file: '.$fname; } -- 2.43.0