From: Michael Andres Date: Mon, 14 Jul 2008 11:38:26 +0000 (+0000) Subject: Also report the name of the locking process in ZYppFactoryException X-Git-Tag: BASE-SuSE-Code-11-Branch~627 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e097b206cdd89896f12dee25ff38e21f1cb72ad;p=platform%2Fupstream%2Flibzypp.git Also report the name of the locking process in ZYppFactoryException --- diff --git a/package/libzypp.changes b/package/libzypp.changes index e432348..3711408 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,18 @@ ------------------------------------------------------------------- +Mon Jul 14 13:36:26 CEST 2008 - ma@suse.de + +- Also report the name of the locking process in ZYppFactoryException + (bnc #280537) +- revision 10572 + +------------------------------------------------------------------- +Mon Jul 14 13:31:28 CEST 2008 - ma@suse.de + +- Provide also the name of the locking process in + ZYppFactoryException () +- revision 10571 + +------------------------------------------------------------------- Mon Jul 14 11:26:30 CEST 2008 - schubi@suse.de - corrected logging onf solver settings diff --git a/zypp/ZYppFactory.cc b/zypp/ZYppFactory.cc index e62a4d7..6c13327 100644 --- a/zypp/ZYppFactory.cc +++ b/zypp/ZYppFactory.cc @@ -89,13 +89,19 @@ namespace zypp catch(...) {} // let no exception escape. } - pid_t locker_pid() const { return _locker_pid; } + pid_t locker_pid() const + { return _locker_pid; } + + const std::string & locker_name() const + { return _locker_name; } + bool _clean_lock; private: FILE *_zypp_lockfile; pid_t _locker_pid; + std::string _locker_name; void openLockFile(const char *mode) { @@ -174,7 +180,8 @@ namespace zypp if ( still_running ) { Pathname p( procdir/"exe" ); - MIL << p << " -> " << filesystem::readlink( p ) << endl; + _locker_name = filesystem::readlink( p ).asString(); + MIL << p << " -> " << _locker_name << endl; p = procdir/"cmdline"; MIL << p << ": "; @@ -351,9 +358,11 @@ namespace zypp /*--------------------------------------------------*/ if ( globalLock.zyppLocked() ) { - std::string t = str::form(N_("System management is locked by the application with pid %d. " + std::string t = str::form(N_("System management is locked by the application with pid %d (%s). " "Please close this application before trying again."), - globalLock.locker_pid()); + globalLock.locker_pid(), + globalLock.locker_name().c_str() + ); ZYPP_THROW(ZYppFactoryException(t, globalLock.locker_pid())); } else