You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/06/20 20:25:48 UTC

[2/2] git commit: [CB-3735] Detect and fix low ulimit.

[CB-3735] Detect and fix low ulimit.


Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/e7189fca
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/e7189fca
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/e7189fca

Branch: refs/heads/master
Commit: e7189fca5a39764c09d14b3716bb3d804e0532d8
Parents: 9da2774
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Jun 20 14:25:13 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Jun 20 14:25:13 2013 -0400

----------------------------------------------------------------------
 coho | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/e7189fca/coho
----------------------------------------------------------------------
diff --git a/coho b/coho
index c9a15aa..75f002a 100755
--- a/coho
+++ b/coho
@@ -1035,6 +1035,13 @@ function main() {
             }
         }).argv;
 
+    // ShellJS opens a lot of file handles, and the default on OS X is too small.
+    var ulimit = execHelper('ulimit -S -n', true, true);
+    if (ulimit && ulimit < 2000) {
+        execHelper('/bin/bash -c \'ulimit -S -n 4096; exec "' + process.argv[0] + '" "' + process.argv.slice(1).join('" "') + '" --ulimit\'');
+        return;
+    }
+
     commandMap[command].entryPoint();
 }
 main();