2004-08-12 18:24:56 +02:00
|
|
|
// Create a process and verify failure exit code.
|
|
|
|
public class Process_4
|
|
|
|
{
|
|
|
|
public static void main(String[] args)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
Runtime r = Runtime.getRuntime();
|
|
|
|
String[] a = { "false" };
|
|
|
|
Process p = r.exec(a);
|
|
|
|
int c = p.waitFor();
|
2005-01-03 20:13:12 +01:00
|
|
|
// Solaris' false doesn't return 1.
|
|
|
|
System.out.println(c != 0 ? "ok" : "bad");
|
2004-08-12 18:24:56 +02:00
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
System.out.println(ex.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|