From 0a0be9c9b4752f4a5a8cda9dd05bf999716d2a9e Mon Sep 17 00:00:00 2001 From: oetiker Date: Tue, 14 Apr 2009 07:51:20 +0000 Subject: [PATCH] Generate an error message when using RRDp with graph - this can not work reliably. (Debian Bug#251701) -- Sebastian Harl git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.3@1790 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/bindings/perl-piped/RRDp.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/program/bindings/perl-piped/RRDp.pm b/program/bindings/perl-piped/RRDp.pm index dc79358c..14cccf46 100644 --- a/program/bindings/perl-piped/RRDp.pm +++ b/program/bindings/perl-piped/RRDp.pm @@ -45,6 +45,9 @@ start RRDtool. The argument must be the path to the RRDtool executable pass commands on to RRDtool. check the RRDtool documentation for more info on the RRDtool commands. +B: Due to design limitations, B does not support the +C command - use C instead. + =item $answer = B read RRDtool's response to your command. Note that the $answer variable will @@ -187,6 +190,13 @@ sub cmd (@){ } $cmd =~ s/\n/ /gs; $cmd =~ s/\s/ /gs; + + # The generated graphs aren't necessarily terminated by a newline, + # causing RRDp::read() to wait for a line matching '^OK' forever. + if ($cmd =~ m/^\s*graph\s+-\s+/) { + croak "RRDp does not support the 'graph -' command - " + . "use 'graphv -' instead"; + } print RRDwriteHand "$cmd\n"; } -- 2.30.2