Skip to content

Commit

Permalink
processing rrdtool output differently due to possible rrdtool bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rinigus committed Jul 8, 2016
1 parent febcce9 commit b35a179
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/graphgenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ void Generator::commandRun()

m_rrdtool_busy = true;
m_rrdtool_output = QString();
m_rrdtool_output_skip_lines = 0;
//m_rrdtool_output_skip_lines = 0;

// the first response line in graph command is the image size
if ( m_command_current.is_graph ) m_rrdtool_output_skip_lines = 1;
// // the first response line in graph command is the image size
// if ( m_command_current.is_graph ) m_rrdtool_output_skip_lines = 1;

com.append("\n");
m_rrdtool->write(com.toLatin1());
Expand All @@ -122,8 +122,10 @@ void Generator::readFromProcess()

// check for ERROR. NB! works for cd and graph commands. some listings could do damage,
// if file named ERROR is in the listed directory
if ( m_rrdtool_output.count('\n') > m_rrdtool_output_skip_lines ||
m_rrdtool_output.indexOf("ERROR") >= 0 )
// if ( m_rrdtool_output.count('\n') > m_rrdtool_output_skip_lines ||
// m_rrdtool_output.indexOf("ERROR") >= 0 )
if ( m_rrdtool_output.indexOf("OK u:") >= 0 ||
m_rrdtool_output.indexOf("ERROR") >= 0 )
{
//qDebug() << "RRDTOOL returned: " << m_rrdtool_output;

Expand Down
2 changes: 1 addition & 1 deletion src/graphgenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public slots:
QString m_rrdtool_output;
CommandQueue m_command_queue;
Command m_command_current;
int m_rrdtool_output_skip_lines = 0;
//int m_rrdtool_output_skip_lines = 0;

size_t m_next_image_index = 0;

Expand Down

0 comments on commit b35a179

Please sign in to comment.