summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2020-04-01 14:04:45 -1000
committerSam Bingner <sam@bingner.com>2020-04-08 13:58:02 -1000
commit22985cb03cf368f77bfea2adf1cddeb91f32fd03 (patch)
tree91d47dd9c5fc75aba167e7bfd5fcc898e2992e7c
parent91448b210bef494122f67b85e0c48295f6ab37e9 (diff)
Fix locking bug that was making cydia get killed
-rw-r--r--MobileCydia.mm9
1 files changed, 3 insertions, 6 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 3365c9b..231a57a 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -3988,8 +3988,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"));
@@ -4011,8 +4010,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"));
@@ -4145,8 +4143,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;