--- old/test/java/lang/Runtime/exec/ExecWithInput.java 2014-02-26 22:54:30.171761395 +0400 +++ new/test/java/lang/Runtime/exec/ExecWithInput.java 2014-02-26 22:54:29.547457241 +0400 @@ -39,7 +39,6 @@ public class ExecWithInput { - private static final String CAT = "/bin/cat"; private static final int N = 200; static int go(int i) throws Exception { @@ -50,8 +49,7 @@ * program exits. Under 1.4.1, cat sometimes gets stuck on a pipe * read and never terminates. */ - //Process p = Runtime.getRuntime().exec(new String[] { CAT } ); - Process p = Runtime.getRuntime().exec(CAT); + Process p = Runtime.getRuntime().exec(UnixCommands.cat()); String input = i + ": line 1\n" + i + ": line 2\n"; StringBufferInputStream in = new StringBufferInputStream(input); @@ -65,10 +63,8 @@ } public static void main(String[] args) throws Exception { - if (!System.getProperty("os.name").equals("Linux")) - return; - if (File.separatorChar == '\\') { - // no /bin/cat on windows + if (! System.getProperty("os.name").startsWith("Linux")) { + System.err.println("Only for Linux"); return; } for (int i = 0; i < N; i++) @@ -93,7 +89,6 @@ public void run() { try { - int c; byte[] buf = new byte[8192]; int n; while ((n = in.read(buf)) != -1) {