Commits

Jens Alfke  committed 5d6c3ea

* MYTask was often not catching the termination status of the task, so it would report success even if the task failed.
* Added a warning to MYDirectoryWatcher if -relativePath gets confused.

  • Participants
  • Parent commits e76c568

Comments (0)

Files changed (2)

File MYDirectoryWatcher.m

     NSString *base = watcher.standardizedPath;
     // stringByStandardizingPath is supposed to resolve symlinks, but in 10.6 this seems to have stopped happening...
     NSString *standardizedPath = [[path stringByResolvingSymlinksInPath] stringByStandardizingPath];
-    if( ! [standardizedPath hasPrefix: base] )
+    if( ! [standardizedPath hasPrefix: base] ) {
+        Warn(@"MYDirectoryWatcher: got path '%@' that's not within base '%@'", standardizedPath, base);
         return nil;
+    }
     unsigned length = base.length;
     while( length < standardizedPath.length && [standardizedPath characterAtIndex: length]=='/' )
         length++;
 - (void) _finishUp
 {
     [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(_finishUp) object: nil];
+    _resultCode = _task.terminationStatus;
     [self _close];
 
     LogTo(MYTaskVerbose, @"Finished!");