Hi,
Why does this code print 256 and exits with 0 status? I would expect it
to print 1 and exit with status 1.
use fmt;
use os;
use os::exec;
export fn main() void = {
let cmd = exec::cmd("false")!;
let proc = exec::start(&cmd)!;
let status = exec::wait(&proc)!;
fmt::printfln("Status: {}", status.status)!;
os::exit(status.status);
};
Hi,
> let status = exec::wait(&proc)!;> fmt::printfln("Status: {}", status.status)!;
status.status is a bit confusing. This field includes some flags
(whether the process exited by itself or was signalled externally)
alongside the actual exit code/signal.
You probably want to use exec::exit(&status) or exec::check(&status) to
decode that field.