diff options
author | stuconnolly <stuart02@gmail.com> | 2011-03-08 20:41:11 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2011-03-08 20:41:11 +0000 |
commit | 4a950f357fb29640b2732ca34c80f81c0b23fbe6 (patch) | |
tree | 8dab179aa98c223a9791889846032c0e960636b4 /Source/SPLogger.m | |
parent | 2baa01621f83df3c81e6b6ed2310d483962dcf48 (diff) | |
download | sequelpro-4a950f357fb29640b2732ca34c80f81c0b23fbe6.tar.gz sequelpro-4a950f357fb29640b2732ca34c80f81c0b23fbe6.tar.bz2 sequelpro-4a950f357fb29640b2732ca34c80f81c0b23fbe6.zip |
Bring outline view branch up to date with trunk (r3227:r3233).
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 |