Skip to content
Snippets Groups Projects
Commit fc181473 authored by wlott's avatar wlott
Browse files

Fixed uses of UNIX-DUP and UNIX-IOCTL to conform to the new semantics.

parent 9e3def80
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/run-program.lisp,v 1.10 1992/02/17 03:11:36 wlott Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/run-program.lisp,v 1.11 1992/02/18 02:20:01 wlott Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -290,10 +290,10 @@ ...@@ -290,10 +290,10 @@
(push master *close-on-error*) (push master *close-on-error*)
(push slave *close-in-parent*) (push slave *close-in-parent*)
(when (streamp pty) (when (streamp pty)
(multiple-value-bind (won new-fd) (unix:unix-dup master) (multiple-value-bind (new-fd errno) (unix:unix-dup master)
(unless won (unless new-fd
(error "Could not UNIX:UNIX-DUP ~D: ~A" (error "Could not UNIX:UNIX-DUP ~D: ~A"
master (unix:get-unix-error-msg new-fd))) master (unix:get-unix-error-msg errno)))
(push new-fd *close-on-error*) (push new-fd *close-on-error*)
(copy-descriptor-to-stream new-fd pty cookie))) (copy-descriptor-to-stream new-fd pty cookie)))
(values name (values name
...@@ -315,7 +315,7 @@ ...@@ -315,7 +315,7 @@
(when pty-name (when pty-name
(let ((old-tty (unix:unix-open "/dev/tty" unix:o_rdwr 0))) (let ((old-tty (unix:unix-open "/dev/tty" unix:o_rdwr 0)))
(when old-tty (when old-tty
(unix:unix-ioctl old-tty unix:TIOCNOTTY 0) (unix:unix-ioctl old-tty unix:TIOCNOTTY nil)
(unix:unix-close old-tty))) (unix:unix-close old-tty)))
(let ((new-tty (unix:unix-open pty-name unix:o_rdwr 0))) (let ((new-tty (unix:unix-open pty-name unix:o_rdwr 0)))
(when new-tty (when new-tty
...@@ -613,14 +613,15 @@ ...@@ -613,14 +613,15 @@
direction))))) direction)))))
((or (pathnamep object) (stringp object)) ((or (pathnamep object) (stringp object))
(with-open-stream (file (apply #'open object keys)) (with-open-stream (file (apply #'open object keys))
(multiple-value-bind (won fd) (multiple-value-bind
(unix:unix-dup (system:fd-stream-fd file)) (fd errno)
(cond (won (unix:unix-dup (system:fd-stream-fd file))
(cond (fd
(push fd *close-in-parent*) (push fd *close-in-parent*)
(values fd nil)) (values fd nil))
(t (t
(error "Could not duplicate file descriptor: ~A" (error "Could not duplicate file descriptor: ~A"
(unix:get-unix-error-msg fd))))))) (unix:get-unix-error-msg errno)))))))
((system:fd-stream-p object) ((system:fd-stream-p object)
(values (system:fd-stream-fd object) nil)) (values (system:fd-stream-fd object) nil))
((streamp object) ((streamp object)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment