From 6993271143bb5a928d3ef3d2ea127cac7d211f75 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 31 Jul 2010 12:41:39 +0200 Subject: [PATCH] [services] client-updates-daemon: only release pid lock if it has been acquired --- services/client-updates-daemon | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/services/client-updates-daemon b/services/client-updates-daemon index 5efa97773..12457f256 100644 --- a/services/client-updates-daemon +++ b/services/client-updates-daemon @@ -261,7 +261,7 @@ class UpdatesDaemon(dbus.service.Object): finally: if entropy is not None: - self.__release_entropy_locks(entropy) + self.__release_entropy_locks(entropy, pid_lock = False) entropy.shutdown() def check_system_changes(self): @@ -386,11 +386,12 @@ class UpdatesDaemon(dbus.service.Object): return True - def __release_entropy_locks(self, entropy): + def __release_entropy_locks(self, entropy, pid_lock = True): # unlock resources entropy.unlock_resources() - # remove application lock - const_remove_entropy_pid() + if pid_lock: + # remove application lock + const_remove_entropy_pid() def __run_fetcher(self, update_repos = True): @@ -477,7 +478,8 @@ class UpdatesDaemon(dbus.service.Object): finally: if entropy is not None: - self.__release_entropy_locks(entropy) + self.__release_entropy_locks(entropy, + pid_lock = update_repos) # say goodbye entropy.shutdown()