fork-job/pty => fork-pty-session.fork-pty-session now closes pty port in child.
This commit is contained in:
parent
abe91e9fd9
commit
bd91c003cc
|
@ -1,7 +1,7 @@
|
||||||
;;; Pseudo terminals
|
;;; Pseudo terminals
|
||||||
;;; Copyright (c) 1995 by Olin Shivers.
|
;;; Copyright (c) 1995 by Olin Shivers.
|
||||||
|
|
||||||
;;; (fork-job/pty thunk)
|
;;; (fork-pty-session thunk)
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;; Fork the process with stdio (fd's 0, 1, & 2 and also the current i/o ports)
|
;;; Fork the process with stdio (fd's 0, 1, & 2 and also the current i/o ports)
|
||||||
;;; bound to a tty device. In the parent process, returns four values:
|
;;; bound to a tty device. In the parent process, returns four values:
|
||||||
|
@ -16,9 +16,10 @@
|
||||||
;;; The child runs with stio hooked up to the tty; the (error-output-port)
|
;;; The child runs with stio hooked up to the tty; the (error-output-port)
|
||||||
;;; port is unbuffered.
|
;;; port is unbuffered.
|
||||||
|
|
||||||
(define (fork-job/pty thunk)
|
(define (fork-pty-session thunk)
|
||||||
(receive (pty-in ttyname) (open-pty)
|
(receive (pty-in ttyname) (open-pty)
|
||||||
(let* ((process (fork (lambda ()
|
(let* ((process (fork (lambda ()
|
||||||
|
(close-input-port pty-in)
|
||||||
(become-session-leader)
|
(become-session-leader)
|
||||||
(let ((tty (open-control-tty ttyname
|
(let ((tty (open-control-tty ttyname
|
||||||
open/read+write)))
|
open/read+write)))
|
||||||
|
|
Loading…
Reference in New Issue