538 |
SecurityManager sm = securityManager; // Be thread-safe! |
SecurityManager sm = securityManager; // Be thread-safe! |
539 |
if (sm != null) |
if (sm != null) |
540 |
sm.checkExec(cmd[0]); |
sm.checkExec(cmd[0]); |
|
if (env == null) |
|
|
env = new String[0]; |
|
541 |
//XXX Should be: return execInternal(cmd, env, dir); |
//XXX Should be: return execInternal(cmd, env, dir); |
542 |
return execInternal(cmd, env); |
return execInternal(cmd, env); |
543 |
} |
} |
743 |
* Execute a process. The command line has already been tokenized, and |
* Execute a process. The command line has already been tokenized, and |
744 |
* the environment should contain name=value mappings. If directory is null, |
* the environment should contain name=value mappings. If directory is null, |
745 |
* use the current working directory; otherwise start the process in that |
* use the current working directory; otherwise start the process in that |
746 |
* directory. |
* directory. If env is null, then the new process should inherit |
747 |
|
* the environment of this process. |
748 |
* XXX Add directory support. |
* XXX Add directory support. |
749 |
* |
* |
750 |
* @param cmd the non-null command tokens |
* @param cmd the non-null command tokens |
751 |
* @param env the non-null environment setup |
* @param env the environment setup |
752 |
* @param dir the directory to use, may be null |
* @param dir the directory to use, may be null |
753 |
* @return the newly created process |
* @return the newly created process |
754 |
* @throws NullPointerException if cmd or env have null elements |
* @throws NullPointerException if cmd or env have null elements |