From ab389260be60fc29691a0d3debd9449ff59fda90 Mon Sep 17 00:00:00 2001 From: Dmytro Tretiakov Date: Tue, 6 Aug 2013 18:29:54 +0300 Subject: [PATCH] Follow up for rev. [67ebc6f] --- Downloading XPC Service/SUDSDownloader.h | 2 +- Downloading XPC Service/SUXPCURLDownload.m | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Downloading XPC Service/SUDSDownloader.h b/Downloading XPC Service/SUDSDownloader.h index f8646427..4275cb2b 100644 --- a/Downloading XPC Service/SUDSDownloader.h +++ b/Downloading XPC Service/SUDSDownloader.h @@ -8,7 +8,7 @@ #import -#define DEBUG_LOGGING_ENABLED defined(DEBUG) && 0 +#define DEBUG_LOGGING_ENABLED defined(DEBUG) && 1 @class SUDSDownloader; diff --git a/Downloading XPC Service/SUXPCURLDownload.m b/Downloading XPC Service/SUXPCURLDownload.m index bfba4545..ebf22340 100644 --- a/Downloading XPC Service/SUXPCURLDownload.m +++ b/Downloading XPC Service/SUXPCURLDownload.m @@ -77,11 +77,10 @@ static NSString * const kSUFetchFolderName = @"fetch.XXXXXXXX"; NSString *tempFileTemplate = [[tempFolder URLByAppendingPathComponent:kSUFetchFolderName] path]; NSString *tempFilePath = [tempFileTemplate stringByAppendingPathComponent:[_destination lastPathComponent]]; - if ([[NSFileManager defaultManager] fileExistsAtPath:tempFilePath]) - { - [[NSFileManager defaultManager] removeItemAtPath:tempFilePath error:nil]; - [[NSFileManager defaultManager] createDirectoryAtPath:tempFilePath withIntermediateDirectories:YES attributes:nil error:nil]; - } + NSFileManager *fileManager = [NSFileManager defaultManager]; + if ([fileManager fileExistsAtPath:tempFilePath]) + [fileManager removeItemAtPath:tempFilePath error:nil]; + _connectionDestination = [tempFilePath copy]; NSData *requestData = [NSKeyedArchiver archivedDataWithRootObject:urlRequest];