From 46c22e2bbfc4345735e3b18bbb1af7e771d88c96 Mon Sep 17 00:00:00 2001 From: Dmytro Tretiakov Date: Mon, 14 Jul 2014 14:20:55 +0300 Subject: [PATCH] Extra follow-up for prev.rev. --- SUBasicUpdateDriver.m | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/SUBasicUpdateDriver.m b/SUBasicUpdateDriver.m index cb22a149..81898190 100644 --- a/SUBasicUpdateDriver.m +++ b/SUBasicUpdateDriver.m @@ -388,19 +388,16 @@ NSArray *SUGetAllDevMateURLHosts(void) #endif // Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems. - if( [SUUpdater shouldUseXPCInstaller] ) + BOOL copiedRelaunchTool = NO; + if (SUShouldUseXPCInstaller()) { - [SUXPCInstaller copyPathWithAuthentication:relaunchPathToCopy overPath:targetPath temporaryName:nil completionHandler:^(NSError *xpcError) { - if (xpcError != nil) - NSLog(@"Error during asynchronous XPC call to copyPath: %@", xpcError); - [self finishRelaunchAfterSuccessfulCopying:(xpcError == nil) fromPath:relaunchPathToCopy toPath:targetPath relaunch:relaunch]; - }]; + copiedRelaunchTool = [SUXPCInstaller copyPathWithAuthentication:relaunchPathToCopy overPath:targetPath temporaryName:nil error:&error]; } else { - BOOL copiedRelaunchTool = [SUPlainInstaller copyPathWithAuthentication: relaunchPathToCopy overPath: targetPath temporaryName: nil error: &error]; - [self finishRelaunchAfterSuccessfulCopying:copiedRelaunchTool fromPath:relaunchPathToCopy toPath:targetPath relaunch:relaunch]; + copiedRelaunchTool = [SUPlainInstaller copyPathWithAuthentication:relaunchPathToCopy overPath:targetPath temporaryName:nil error:&error]; } + [self finishRelaunchAfterSuccessfulCopying:copiedRelaunchTool fromPath:relaunchPathToCopy toPath:targetPath relaunch:relaunch]; } - (void)finishRelaunchAfterSuccessfulCopying:(BOOL)copiedRelaunchTool fromPath:(NSString *)relaunchPathToCopy toPath:(NSString *)targetPath relaunch:(BOOL)relaunch