test/java/lang/Runtime/exec/Status.java

Print this page

        

@@ -33,14 +33,19 @@
     private static int N = 160;
 
     public static void main(String args[])
         throws Exception
     {
-        if (!System.getProperty("os.name").equals("Linux"))
+        if (!System.getProperty("os.name").equals("Linux")) {
+            System.out.println("Only for Linux");
             return;
+        }
+        UnixCommands.ensureCommandsAvailable("false");
+
+        final String falseCmd = UnixCommands.findCommand("false");
         for (int i = 0; i < N; i++) {
-            Process p = Runtime.getRuntime().exec("false");
+            Process p = Runtime.getRuntime().exec(falseCmd);
             int s = p.waitFor();
             System.out.print(s);
             System.out.print(' ');
             if (s != 1) {
                 System.out.println();