Commits

hakanw  committed 9be32df

quiet ping's errors, so we're not spewing to stderr

  • Participants
  • Parent commits e581325

Comments (0)

Files changed (1)

File AppController.m

 	// -t 2 = timeout of 2 secs
 	NSArray *args = [NSArray arrayWithObjects:@"-o", @"-t", @"2", @"google.com", nil];
 		
-	NSTask *ping = [NSTask launchedTaskWithLaunchPath:@"/sbin/ping" arguments:args];
+	NSTask *ping = [NSTask new];
+  [ping setStandardError:[NSFileHandle fileHandleWithNullDevice]];
+  [ping setLaunchPath:@"/sbin/ping"];
+  [ping setArguments:args];
+  [ping launch];
 	// block until ping is finished.
 	[ping waitUntilExit];