fork-job/pty => fork-pty-session.fork-pty-session now closes pty port in child.

This commit is contained in:
shivers 1995-10-27 08:57:10 +00:00
parent abe91e9fd9
commit bd91c003cc
1 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,7 @@
;;; Pseudo terminals
;;; 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)
;;; 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)
;;; port is unbuffered.
(define (fork-job/pty thunk)
(define (fork-pty-session thunk)
(receive (pty-in ttyname) (open-pty)
(let* ((process (fork (lambda ()
(close-input-port pty-in)
(become-session-leader)
(let ((tty (open-control-tty ttyname
open/read+write)))