activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1083846 - /activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
Date Mon, 21 Mar 2011 15:49:33 GMT
Author: chirino
Date: Mon Mar 21 15:49:32 2011
New Revision: 1083846

URL: http://svn.apache.org/viewvc?rev=1083846&view=rev
Log:
The ulimit stuff does not apply on windows

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala?rev=1083846&r1=1083845&r2=1083846&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
Mon Mar 21 15:49:32 2011
@@ -375,7 +375,7 @@ class Broker() extends BaseService {
       // Try to get a better version from the OS itself..
       val los = os.toLowerCase()
       if( los.startsWith("linux") ) {
-        capture("lsb_release", "-sd").map("%s (%s)".format(_, rc)).getOrElse(rc)
+        capture("lsb_release", "-sd").map("%s (%s)".format(rc, _)).getOrElse(rc)
       } else {
         rc
       }
@@ -394,9 +394,12 @@ class Broker() extends BaseService {
     console_log.info("Apollo : %s", Broker.version)
 
   }
-  private def check_file_limit = {
-    import ProcessSupport._
+  private def check_file_limit:Unit = {
+    if( System.getProperty("os.name").toLowerCase().startsWith("windows") ) {
+      return
+    }
 
+    import ProcessSupport._
     def process(out:Array[Byte]) = try {
       val limit = new String(out).trim
       console_log.info("OS is restricting the open file limit to: %s", limit)
@@ -425,10 +428,14 @@ class Broker() extends BaseService {
       }
     } catch {
       case _ =>
-        launch("sh", "-c", "ulimit -n") { case (rc, out, err) =>
-          if( rc==0 ) {
-            process(out)
+        try {
+          launch("sh", "-c", "ulimit -n") { case (rc, out, err) =>
+            if( rc==0 ) {
+              process(out)
+            }
           }
+        } catch {
+          case _ =>
         }
     }
 



Mime
View raw message