diff options
Diffstat (limited to 'Source/SPLogger.m')
-rw-r--r-- | Source/SPLogger.m | 18 |
1 files changed, 9 insertions, 9 deletions
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 |