| 326 | } |
| 327 | |
| 328 | func (r *runner) checkTerminal(config *specs.Process) error { |
| 329 | detach := r.detach || (r.action == CT_ACT_CREATE) |
| 330 | // Check command-line for sanity. |
| 331 | if detach && config.Terminal && r.consoleSocket == "" { |
| 332 | return errors.New("cannot allocate tty if runc will detach without setting console socket") |
| 333 | } |
| 334 | if (!detach || !config.Terminal) && r.consoleSocket != "" { |
| 335 | return errors.New("cannot use console socket if runc will not detach or allocate tty") |
| 336 | } |
| 337 | return nil |
| 338 | } |
| 339 | |
| 340 | func validateProcessSpec(spec *specs.Process) error { |
| 341 | if spec == nil { |