return PID from command function
This commit is contained in:
parent
f6faf029cd
commit
e55a619862
1 changed files with 14 additions and 8 deletions
|
@ -812,13 +812,19 @@ pub fn command(stack: &mut Stack) -> OError {
|
||||||
if args.is_empty() {
|
if args.is_empty() {
|
||||||
return stack.err(ErrorKind::InvalidCall("command".to_owned()));
|
return stack.err(ErrorKind::InvalidCall("command".to_owned()));
|
||||||
}
|
}
|
||||||
process::Command::new(&args[0])
|
stack.push(
|
||||||
.args(&args[1..])
|
Value::Long(
|
||||||
.stdin(Stdio::inherit())
|
process::Command::new(&args[0])
|
||||||
.stdout(Stdio::inherit())
|
.args(&args[1..])
|
||||||
.stderr(Stdio::inherit())
|
.stdin(Stdio::inherit())
|
||||||
.spawn()
|
.stdout(Stdio::inherit())
|
||||||
.map_err(|x| stack.error(ErrorKind::IO(x.to_string())))?;
|
.stderr(Stdio::inherit())
|
||||||
|
.spawn()
|
||||||
|
.map_err(|x| stack.error(ErrorKind::IO(x.to_string())))?
|
||||||
|
.id() as i64,
|
||||||
|
)
|
||||||
|
.spl(),
|
||||||
|
);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1195,7 +1201,7 @@ pub fn register(r: &mut Stack, o: Arc<Frame>) {
|
||||||
("alit-end", alit_end, 1),
|
("alit-end", alit_end, 1),
|
||||||
("import", import, 0),
|
("import", import, 0),
|
||||||
("readln", readln, 1),
|
("readln", readln, 1),
|
||||||
("command", command, 0),
|
("command", command, 1),
|
||||||
("command-wait", command_wait, 1),
|
("command-wait", command_wait, 1),
|
||||||
("str-to-bytes", str_to_bytes, 1),
|
("str-to-bytes", str_to_bytes, 1),
|
||||||
("bytes-to-str", bytes_to_str, 1),
|
("bytes-to-str", bytes_to_str, 1),
|
||||||
|
|
Loading…
Add table
Reference in a new issue