Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Redirect stdout to a file, to work around a hang in iOS 5.1.

Change-Id: If28a5c60f1f1366600701efb3544cc2125daa244
http://www.couchbase.com/issues/browse/CBMI-72
Reviewed-on: http://review.couchbase.org/13924
Reviewed-by: Chris Anderson <jchris@couchbase.com>
Tested-by: Jens Alfke <jens@couchbase.com>
  • Loading branch information...
commit abc0542eb1c2a2c735cb66d25c50878f92730d1a 1 parent 4c211a4
@snej snej authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 Framework/Classes/CouchbaseMobile.m
View
5 Framework/Classes/CouchbaseMobile.m
@@ -187,6 +187,11 @@ - (BOOL)start
fromDir: _bundlePath
toDir: _rootDirectory])
return NO;
+
+ // Redirect stdout somewhere. Otherwise Erlang will lock up in iOS 5.1+ when it calls printf. (CBMI-72)
+ NSString* stdoutFile = [self.logDirectory stringByAppendingPathComponent: @"stdout.txt"];
+ NSLog(@"Couchbase: Redirecting stdout to %@", stdoutFile);
+ freopen([stdoutFile UTF8String], "w+", stdout);
_started = YES;
[self performSelector: @selector(startupTimeout) withObject: nil afterDelay: kWaitTimeout];
Please sign in to comment.
Something went wrong with that request. Please try again.