[yast-commit] r57304 - /trunk/storage/libstorage/src/EtcFstab.cc

Author: aschnell Date: Mon May 25 12:44:10 2009 New Revision: 57304 URL: http://svn.opensuse.org/viewcvs/yast?rev=57304&view=rev Log: - some cleanup Modified: trunk/storage/libstorage/src/EtcFstab.cc Modified: trunk/storage/libstorage/src/EtcFstab.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/EtcFstab.c... ============================================================================== --- trunk/storage/libstorage/src/EtcFstab.cc (original) +++ trunk/storage/libstorage/src/EtcFstab.cc Mon May 25 12:44:10 2009 @@ -651,19 +651,21 @@ int EtcFstab::flush() { int ret = 0; - list<Entry>::iterator i = co.begin(); AsciiFile *fstab = NULL; AsciiFile *cryptotab = NULL; AsciiFile *cur = NULL; AsciiFile crypttab( prefix + "/crypttab", true ); - int lineno; - if( i!=co.end() && !checkDir( prefix ) ) + if (!co.empty() && !checkDir(prefix)) createPath( prefix ); + + list<Entry>::iterator i = co.begin(); while( i!=co.end() && ret==0 ) { switch( i->op ) { case Entry::REMOVE: + { + int lineno; cur = findFile( i->old, fstab, cryptotab, lineno ); if( lineno>=0 ) { @@ -675,8 +677,11 @@ else ret = FSTAB_REMOVE_ENTRY_NOT_FOUND; i = co.erase( i ); - break; + } break; + case Entry::UPDATE: + { + int lineno; cur = findFile( i->old, fstab, cryptotab, lineno ); if( lineno<0 ) cur = findFile( i->nnew, fstab, cryptotab, lineno ); @@ -723,9 +728,11 @@ } else ret = FSTAB_UPDATE_ENTRY_NOT_FOUND; - break; + } break; + case Entry::ADD: - { + { + int lineno; cur = findFile( i->nnew, fstab, cryptotab, lineno ); string line = createTabLine( i->nnew ); string before_dev; @@ -764,8 +771,8 @@ } i->old = i->nnew; i->op = Entry::NONE; - } - break; + } break; + default: break; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn.opensuse.org