Author: aschnell
Date: Tue Nov 11 13:38:43 2008
New Revision: 53167
URL: http://svn.opensuse.org/viewcvs/yast?rev=53167&view=rev
Log:
- some cleanup
Modified:
trunk/storage/libstorage/src/SystemCmd.cc
trunk/storage/libstorage/src/SystemCmd.h
Modified: trunk/storage/libstorage/src/SystemCmd.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/SystemCmd.cc?rev=53167&r1=53166&r2=53167&view=diff
==============================================================================
--- trunk/storage/libstorage/src/SystemCmd.cc (original)
+++ trunk/storage/libstorage/src/SystemCmd.cc Tue Nov 11 13:38:43 2008
@@ -22,9 +22,6 @@
using namespace storage;
-//#define FULL_DEBUG_SYSTEM_CMD
-
-
SystemCmd::SystemCmd( const char* Command )
{
y2mil("constructor SystemCmd:\"" << Command << "\"");
@@ -162,7 +159,7 @@
Ret_i = ret;
y2milestone( "ret:%d ExceedTime:%d ExceedLines:%d", ret, ExceedTime,
ExceedLines );
- return( ret );
+ return ret;
}
@@ -311,7 +308,7 @@
y2milestone( "system() Returns:%d", Ret_i );
if( Ret_i!=0 )
logOutput();
- return( Ret_i );
+ return Ret_i;
}
@@ -365,7 +362,7 @@
}
y2debug( "Wait:%d pid=%d stat=%d Hang:%d Ret:%d", Wait_ii, Pid_i,
Status_ii, Hang_bv, Ret_ir );
- return( Wait_ii != 0 );
+ return Wait_ii != 0;
}
void
@@ -395,7 +392,7 @@
}
Valid_ab[Idx_iv] = true;
}
- return( &Text_aC[Idx_iv] );
+ return &Text_aC[Idx_iv];
}
unsigned
@@ -416,7 +413,7 @@
Ret_ii = Lines_aC[Idx_iv].size();
}
y2debug("ret:%u", Ret_ii );
- return( Ret_ii );
+ return Ret_ii;
}
const string *
@@ -442,7 +439,7 @@
Ret_pCi = &Lines_aC[Idx_iv][Nr_iv];
}
}
- return( Ret_pCi );
+ return Ret_pCi;
}
int
@@ -485,7 +482,7 @@
}
y2milestone( "Pid:%d Idx:%d Pattern:\"%s\" Invert:%d Lines %d", Pid_i,
Idx_iv, Pat_Cv.c_str(), Invert_bv, Size_ii );
- return( Size_ii );
+ return Size_ii;
}
void
@@ -546,10 +543,7 @@
}
if( OutputHandler_f )
{
-#ifdef SYSTEMCMD_VERBOSE_DEBUG
- y2debug( "Calling Output-Handler Buf:\"%s\" Stderr:%d", Buf_ti,
- Stderr_bv );
-#endif
+ y2deb("Calling Output-Handler Buf:\"" << Buf_ti << "\" Stderr:" << Stderr_bv);
OutputHandler_f( HandlerPar_p, Buf_ti, Stderr_bv );
}
}
@@ -565,10 +559,7 @@
}
if( OutputHandler_f )
{
-#ifdef SYSTEMCMD_VERBOSE_DEBUG
- y2debug( "Calling Output-Handler Buf:\"%s\" Stderr:%d",< Buf_ti
- Stderr_bv );
-#endif
+ y2deb("Calling Output-Handler Buf:\"" << Buf_ti << "\" Stderr:" << Stderr_bv);
OutputHandler_f( HandlerPar_p, Buf_ti, Stderr_bv );
}
}
@@ -619,22 +610,25 @@
y2debug( "Text_Ci:%s NewLine:%d", Text_Cr.c_str(), NewLine_br );
}
+
void
-SystemCmd::addLine( string Text_Cv, vector<string>& Lines_Cr )
+SystemCmd::addLine(string Text_Cv, vector<string>& Lines_Cr)
+{
+ if (Lines_Cr.size() < 100)
{
-#ifndef FULL_DEBUG_SYSTEM_CMD
- if( Lines_Cr.size()<100 )
- {
-#endif
- y2milestone( "Adding Line %zd \"%s\"", Lines_Cr.size()+1, Text_Cv.c_str() );
-#ifndef FULL_DEBUG_SYSTEM_CMD
- }
-#endif
- Lines_Cr.push_back( Text_Cv );
+ y2mil("Adding Line " << Lines_Cr.size() + 1 << " \"" << Text_Cv << "\"");
}
+ else
+ {
+ y2deb("Adding Line " << Lines_Cr.size() + 1 << " \"" << Text_Cv << "\"");
+ }
+
+ Lines_Cr.push_back(Text_Cv);
+}
+
void
-SystemCmd::logOutput()
+SystemCmd::logOutput() const
{
for( unsigned i=0; i