Author: aschnell Date: Mon Aug 18 20:34:41 2008 New Revision: 50190 URL: http://svn.opensuse.org/viewcvs/yast?rev=50190&view=rev Log: - cleanup Modified: trunk/storage/libstorage/src/Region.h trunk/storage/libstorage/src/Storage.cc trunk/storage/libstorage/src/StorageDefines.h Modified: trunk/storage/libstorage/src/Region.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Region.h?r... ============================================================================== --- trunk/storage/libstorage/src/Region.h (original) +++ trunk/storage/libstorage/src/Region.h Mon Aug 18 20:34:41 2008 @@ -9,8 +9,8 @@ class Region { public: - Region() : s(0), l(0) {}; - Region( unsigned long start, unsigned long len ) : s(start), l(len) {}; + Region() : s(0), l(0) {} + Region( unsigned long start, unsigned long len ) : s(start), l(len) {} Region( const Region& x ) { *this = x; } Region& operator=(const Region& r) Modified: trunk/storage/libstorage/src/Storage.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.cc... ============================================================================== --- trunk/storage/libstorage/src/Storage.cc (original) +++ trunk/storage/libstorage/src/Storage.cc Mon Aug 18 20:34:41 2008 @@ -2844,10 +2844,6 @@ { ret = STORAGE_LVM_VG_NOT_FOUND; } - if (ret == 0) - { - ret = checkCache(); - } y2mil("ret:" << ret); return ret; } @@ -5734,21 +5730,21 @@ extendedError = txt; } + int Storage::waitForDevice() const - { +{ int ret = 0; - const char * prog = "/sbin/udevsettle"; - if( access( prog, X_OK )==0 ) - { - string cmd( prog ); - cmd += " --timeout=20"; - y2milestone( "calling prog:%s", cmd.c_str() ); - SystemCmd c( cmd ); - y2milestone( "returned prog:%s retcode:%d", cmd.c_str(), c.retcode() ); - } - y2milestone( "ret:%d", ret ); - return( ret ); + if (access(UDEVSETTLEBIN, X_OK) == 0) + { + string cmd(UDEVSETTLEBIN " --timeout=20"); + y2mil("calling prog:" << cmd); + SystemCmd c(cmd); + y2mil("returned prog:" << cmd << " retcode:" << c.retcode()); } + y2mil("ret:" << ret); + return ret; +} + int Storage::waitForDevice( const string& device ) const { @@ -5773,21 +5769,21 @@ return( ret ); } + void Storage::checkDeviceExclusive( const string& device, unsigned secs ) - { +{ const int delay = 50000; - unsigned count = secs * 1000000/delay; - int fd; + const unsigned count = secs * 1000000/delay; y2mil( "dev:" << device << " sec:" << secs << " count:" << count ); for( unsigned i=0; i<count; i++ ) - { - fd = open( device.c_str(), O_RDONLY|O_EXCL ); + { + int fd = open( device.c_str(), O_RDONLY|O_EXCL ); y2mil( "count:" << i << " fd:" << fd ); if( fd>=0 ) close(fd); usleep( delay ); - } } +} string Storage::byteToHumanString(unsigned long long size, bool classic, int precision, Modified: trunk/storage/libstorage/src/StorageDefines.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageDef... ============================================================================== --- trunk/storage/libstorage/src/StorageDefines.h (original) +++ trunk/storage/libstorage/src/StorageDefines.h Mon Aug 18 20:34:41 2008 @@ -43,5 +43,7 @@ #define DASDVIEWBIN "/sbin/dasdview" #define FDASDBIN "/sbin/fdasd" +#define UDEVSETTLEBIN "/sbin/udevsettle" + #endif -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org