Author: aschnell Date: Thu Mar 5 16:02:43 2009 New Revision: 55942 URL: http://svn.opensuse.org/viewcvs/yast?rev=55942&view=rev Log: - cleanup Modified: trunk/storage/libstorage/src/Storage.cc Modified: trunk/storage/libstorage/src/Storage.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.cc?rev=55942&r1=55941&r2=55942&view=diff ============================================================================== --- trunk/storage/libstorage/src/Storage.cc (original) +++ trunk/storage/libstorage/src/Storage.cc Thu Mar 5 16:02:43 2009 @@ -838,21 +838,23 @@ handleLogFile( fname ); } + bool -Storage::testFilesEqual( const string& n1, const string& n2 ) - { +Storage::testFilesEqual(const string& n1, const string& n2) +{ bool ret = false; - if( access( n1.c_str(), R_OK )==0 && access( n2.c_str(), R_OK )==0 ) + if (access(n1.c_str(), R_OK) == 0 && access(n2.c_str(), R_OK) == 0) + { + SystemCmd cmd("/usr/bin/md5sum " + quote(n1) + " " + quote(n2)); + if (cmd.retcode() == 0 && cmd.stdout().size() >= 2) { - SystemCmd c("/usr/bin/md5sum " + quote(n1) + " " + quote(n2)); - if( c.retcode()==0 && c.numLines()>=2 ) - { - ret = extractNthWord( 0, c.getLine(0) ) == extractNthWord( 0, c.getLine(1) ); - } + ret = extractNthWord(0, cmd.stdout()[0]) == extractNthWord(0, cmd.stdout()[1]); } - y2mil("ret:" << ret << "n1:" << n1 << " n2:" << n2); - return ret; } + y2mil("ret:" << ret << " n1:" << n1 << " n2:" << n2); + return ret; +} + void Storage::handleLogFile( const string& name ) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org