Closed anti-social closed 8 years ago
Implemented terminal control in the vagga, all tests passed.
Dont understand how I could rid of ErrorCode
for setpgid. Why we need ErrorCode
enum at all? I think there should be only Error
enum with different From
implementations.
Why we need ErrorCode enum at all?
Error code is sent from child process to parent when eror happens in child. So it is required only for errors that happen in child.
Othewise looks fine. You may squash the commits.
To rid of ErrorCode::SetPGid
I should write something like:
match setpgid(pid, pid) {
Ok(_) => {},
Result::Err(nix::Error::Sys(x)) => return Result::Err(Error::SetPGid(x as i32)),
Result::Err(nix::Error::InvalidPath) => return Result::Err(Error::InvalidPath),
}
Also there are another errors with codes that happen only in parent process.
Ah, sorry. I probably misremember something :)
Apart from coments in code, I think that group leadership should be contributed here. But the terminal control should be implemented in the vagga itself.