From 4a950f357fb29640b2732ca34c80f81c0b23fbe6 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Tue, 8 Mar 2011 20:41:11 +0000 Subject: Bring outline view branch up to date with trunk (r3227:r3233). --- Source/SPLogger.m | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Source/SPLogger.m') diff --git a/Source/SPLogger.m b/Source/SPLogger.m index 5736fde6..b1e16bba 100644 --- a/Source/SPLogger.m +++ b/Source/SPLogger.m @@ -37,6 +37,7 @@ static SPLogger *logger = nil; - (void)_initLogFile; - (void)_outputTimeString; +int _isSPLeaksLog(struct direct *entry); @end @@ -137,10 +138,9 @@ static SPLogger *logger = nil; if ([self removeOldLeakDumpsOnTermination]) { int cnt, cnt2, i; - int isSPLeaksLog(); struct direct **files; - cnt = scandir("/tmp", &files, isSPLeaksLog, NULL); + cnt = scandir("/tmp", &files, _isSPLeaksLog, NULL); char fpath[32], fpath2[32], fpath3[64]; @@ -158,7 +158,7 @@ static SPLogger *logger = nil; if (hdir) { snprintf(fpath2, sizeof(fpath2), "%s/Desktop", pw->pw_dir); - cnt2 = scandir(fpath2, &files, isSPLeaksLog, NULL); + cnt2 = scandir(fpath2, &files, _isSPLeaksLog, NULL); for (i = 0; i < cnt2; i++) { @@ -181,7 +181,7 @@ static SPLogger *logger = nil; // Write new leaks log if ((fp = popen(cmd, "r")) && (fp2 = fopen(file, "w"))) { - while (len = fread(buf, 1, sizeof(buf), fp)) + while ((len = fread(buf, 1, sizeof(buf), fp))) { fwrite(buf, 1, len, fp2); } @@ -191,11 +191,6 @@ static SPLogger *logger = nil; } } -int isSPLeaksLog(struct direct *entry) -{ - return (strstr(entry->d_name, "sp.leaks") != NULL); -} - #pragma mark - #pragma mark Private API @@ -249,4 +244,9 @@ int isSPLeaksLog(struct direct *entry) [logFileHandle writeData:[[NSString stringWithFormat:@"Launched at %@\n\n", [[NSDate date] description]] dataUsingEncoding:NSUTF8StringEncoding]]; } +int _isSPLeaksLog(struct direct *entry) +{ + return (strstr(entry->d_name, "sp.leaks") != NULL); +} + @end -- cgit v1.2.3