From e287ac6ceb199e27206135c77a51e88d5b9f9417 Mon Sep 17 00:00:00 2001 From: Sam Bingner Date: Wed, 1 Apr 2020 14:04:45 -1000 Subject: Fix locking bug that was making cydia get killed --- MobileCydia.mm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index 192029b..7d0b2ba 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -3977,8 +3977,7 @@ class CydiaLogCleaner : if (lock_ != NULL) return false; - FileFd Lock; - Lock.Fd(GetLock(_config->FindDir("Dir::Cache::Archives") + "lock")); + FileFd Lock = FileFd(GetLock(_config->FindDir("Dir::Cache::Archives") + "lock"), true); NSString *title(UCLocalize("CLEAN_ARCHIVES")); @@ -4000,8 +3999,7 @@ class CydiaLogCleaner : pkgRecords records(cache_); - lock_ = new FileFd(); - lock_->Fd(GetLock(_config->FindDir("Dir::Cache::Archives") + "lock")); + lock_ = new FileFd(GetLock(_config->FindDir("Dir::Cache::Archives") + "lock"), true); NSString *title(UCLocalize("PREPARE_ARCHIVES")); @@ -4134,8 +4132,7 @@ class CydiaLogCleaner : if ([self popErrorWithTitle:title forReadList:list]) return; - FileFd lock; - lock.Fd(GetLock(_config->FindDir("Dir::State::Lists") + "lock")); + FileFd lock = FileFd(GetLock(_config->FindDir("Dir::State::Lists") + "lock"), true); if ([self popErrorWithTitle:title]) return; -- cgit v1.2.3