Permalink
Browse files

Try merging stdout into stderr to avoid buffering.

  • Loading branch information...
1 parent b8f30b7 commit 640471db7d90c0a0938b1057a78fd62ad6288b34 Rob Holland committed Jun 25, 2010
Showing with 5 additions and 5 deletions.
  1. +5 −5 Simulator.m
View
@@ -12,7 +12,7 @@
#include <objc/runtime.h>
#define WaxLog(format, args...) \
- printf("%s\n", [[NSString stringWithFormat:(format), ## args] UTF8String])
+ fprintf(stderr, "%s\n", [[NSString stringWithFormat:(format), ## args] UTF8String])
@implementation Simulator
@@ -89,12 +89,12 @@ - (int)launch {
[config setSimulatedApplicationLaunchEnvironment:_env];
[config setLocalizedClientName:@"iCuke"];
- // Make the simulator output to the current STDOUT & STDERR
+ // Make the simulator output to the current STDERR
+ // We mix them together to avoid buffering issues on STDOUT
char path[MAXPATHLEN];
- fcntl(STDOUT_FILENO, F_GETPATH, &path);
- [config setSimulatedApplicationStdOutPath:[NSString stringWithUTF8String:path]];
-
+
fcntl(STDERR_FILENO, F_GETPATH, &path);
+ [config setSimulatedApplicationStdOutPath:[NSString stringWithUTF8String:path]];
[config setSimulatedApplicationStdErrPath:[NSString stringWithUTF8String:path]];
_session = [[DTiPhoneSimulatorSession alloc] init];

0 comments on commit 640471d

Please sign in to comment.