Author: nextgens
Date: 2007-05-01 15:46:09 +0000 (Tue, 01 May 2007)
New Revision: 13082

Modified:
   trunk/apps/new_installer/src/BindTest.java
Log:
new_installer: the fix for #1329 breaks on windows :< ... YetANewWorkaround, 
part 3

Modified: trunk/apps/new_installer/src/BindTest.java
===================================================================
--- trunk/apps/new_installer/src/BindTest.java  2007-05-01 15:29:42 UTC (rev 
13081)
+++ trunk/apps/new_installer/src/BindTest.java  2007-05-01 15:46:09 UTC (rev 
13082)
@@ -14,16 +14,13 @@
                        Integer port = Integer.valueOf(args[0]);
                        ServerSocket ss = null;
                        /* workaround a macos|windows problem */
-                       String os = System.getProperty("os.name");
-                       if(os != null && os.equalsIgnoreCase("Windows"))
-                               ss = new ServerSocket(port.intValue());
-                       else {
-                               ss = new ServerSocket();
+                       String os = System.getProperty("os.name").toLowerCase();
+                       ss = new ServerSocket();
+                       if(os.startsWith("mac"))
                                ss.setReuseAddress(false);
-                               ss.bind(new InetSocketAddress("127.0.0.1:", 
port.intValue()));
-                               if(!ss.isBound())
-                                       System.exit(1);
-                       }
+                       ss.bind(new InetSocketAddress("127.0.0.1:", 
port.intValue()));
+                       if(!ss.isBound())
+                               System.exit(1);

                        ss.setSoTimeout(200);
                        ss.accept();


Reply via email to