From: William H. N. <wn...@us...> - 2003-04-08 23:57:10
|
Update of /cvsroot/sbcl/sbcl/src/code In directory sc8-pr-cvs1:/tmp/cvs-serv10242 Modified Files: fd-stream.lisp unix.lisp Log Message: 0.pre8.49: merged antonio martinez' INTERACTIVE-STREAM-P and *STANDARD-INPUT* patches (sbcl-devel ca. 2003-04-07) Index: fd-stream.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/code/fd-stream.lisp,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- fd-stream.lisp 29 Mar 2003 13:03:40 -0000 1.31 +++ fd-stream.lisp 8 Apr 2003 23:57:06 -0000 1.32 @@ -848,7 +848,8 @@ (fd-stream-element-type fd-stream)) (:interactive-p ;; FIXME: sb!unix:unix-isatty is undefined. - (sb!unix:unix-isatty (fd-stream-fd fd-stream))) + (= 1 (the (member 0 1) + (sb!unix:unix-isatty (fd-stream-fd fd-stream))))) (:line-length 80) (:charpos @@ -1234,14 +1235,7 @@ (stream-reinit) (setf *terminal-io* (make-synonym-stream '*tty*)) (setf *standard-output* (make-synonym-stream '*stdout*)) - (setf *standard-input* - (#!-high-security - ;; FIXME: Why is *STANDARD-INPUT* a TWO-WAY-STREAM? ANSI says - ;; it's an input stream. - make-two-way-stream - #!+high-security - %make-two-way-stream (make-synonym-stream '*stdin*) - *standard-output*)) + (setf *standard-input* (make-synonym-stream '*stdin*)) (setf *error-output* (make-synonym-stream '*stderr*)) (setf *query-io* (make-synonym-stream '*terminal-io*)) (setf *debug-io* *query-io*) Index: unix.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/code/unix.lisp,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- unix.lisp 3 Apr 2003 18:27:17 -0000 1.33 +++ unix.lisp 8 Apr 2003 23:57:06 -0000 1.34 @@ -204,6 +204,11 @@ (defconstant l_incr 1) ; to increment the file pointer (defconstant l_xtnd 2) ; to extend the file size +;;; Is a stream interactive? +(defun unix-isatty (fd) + (declare (type unix-fd fd)) + (int-syscall ("isatty" int) fd)) + ;;; Accept a file descriptor and move the file pointer ahead ;;; a certain offset for that file. WHENCE can be any of the following: ;;; L_SET Set the file pointer. |