rust: Catch ioctl error when trying to cal tc.*grp functions
This commit is contained in:
parent
c5662606df
commit
2bf0cff7be
1 changed files with 8 additions and 2 deletions
10
env/rust.scm
vendored
10
env/rust.scm
vendored
|
@ -79,7 +79,10 @@ function."
|
|||
(let* ((_ (reload-module (resolve-module '(guix scripts environment))))
|
||||
(launch (@@ (guix scripts environment) launch-environment/container))
|
||||
(setup-fhs (@@ (guix scripts environment) setup-fhs))
|
||||
(tcgrp (tcgetpgrp (current-input-port))))
|
||||
(tcgrp (catch 'system-error
|
||||
;; catching ioctl for some types of prompts.
|
||||
(λ () (tcgetpgrp (current-input-port)))
|
||||
(const #f))))
|
||||
;; during launch-environment/container does at least one fork take place,
|
||||
;; for some reason when child exits this process receives SIGTTOU and
|
||||
;; SIGTTIN signals which put it to wait. Looks like a side-effect of hacks
|
||||
|
@ -105,7 +108,10 @@ function."
|
|||
;; for the terminal used by input port changed after child
|
||||
;; exits. That causes input/output error when we jump back to
|
||||
;; the prompt.
|
||||
(tcsetpgrp (current-input-port) tcgrp)
|
||||
(when tcgrp
|
||||
;; only setting it back when there were no ioctl error (see let*
|
||||
;; form above)
|
||||
(tcsetpgrp (current-input-port) tcgrp))
|
||||
;; Why not?
|
||||
(flush-all-ports)))))
|
||||
|
||||
|
|
Loading…
Reference in a new issue